Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please Help with all parts! For each of the following questions, find the inputs

ID: 3742915 • Letter: P

Question

Please Help with all parts!

For each of the following questions, find the inputs and outputs, write the algorithm, and test the algorithm.

a) An airline has three different ticket prices depending on seating locations: business class, economy, and exit row.  Business class has 8 seats, economy has 84 seats, and exit row has 12 seats.  The airline wants a program that will calculate and display the amount of revenue generated by each seating location as well as the total.

b) A trading company wants a program to convert American dollars to European Union Eros, Belize Dollars, and Costa Rican Colóns.  The following conversion rate for one American dollar can be used: 0.86 Euros, 2.01 Belize Dollars, and 567.84 Costa Rican Colóns.

Explanation / Answer

Question A.

Inputs:

business_class_price

economy_price

exit_price

business_booked

economy_booked

exit_booked

Outputs:

business_revenue

economy_revenue

exit_revenue

total_revenue

Algorithm:

1. Read business_class_price, economy_price, exit_price

2. Read business_booked, economy_booked, exit_booked

3. business_revenue = business_class_price * business_booked

4. economy_revenue = economy_price * economy_booked

5. exit_revenue = exit_price * exit_booked

6. total_revenue = business_revenue + economy_revenue + exit_revenue

Question B:

Inputs:

dollars

Outputs:

european_union_eros

belize_dollars

costa_rican_colons

Algorithm:

1. Read dollars amount

2. european_union_eros = 0.86 * dollars

3. belize_dollars = 2.01 * dollars

4. costa_rican_colons = 567.84 * dollars

**Comment for any queries, I am happy to help...:))