Write the code that will prompt them for the category they


The program you will create is to allow a user to enter the type of seats on an airplane they would like (first class, business class, coach, economy) and you will write the code that will prompt them for the category they want to purchase and you will print out the number of seats available for that type of seat category.

You will use the 2 parallel arrays, seats[] ={5, 3,1,2} and price[] ={1200, 850, 600, 450} ; seats[] represents the number of seats available for each category - seats[0] = 5, which means there are 5 seats available in first class. seats[1] = 3 which means there are 3 seats available in business class, etc. price[] represents the price for each of these categories of seats: price[0] = 1200 which means a first class seat costs 1200 dollars

The output should look like

Welcome to Delta Airlines!

Please enter the amount of money you have to spend on a seat:

550

You can buy a seat in category 3.

Which category would you like to inquire about?

0

Category 0 has 5 seats available

Would you like a seat in category 0?

No

Which category would you like to inquire about?

1

Category 1 has 3 seats available

Would you like a seat in category 1?

Yes

Thank you for flying with us! You have a seat in category 1 for 850 dollars

New values for arrays:

seats[] = 5 2 1 2

prices[] = 1200 850 600 450

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write the code that will prompt them for the category they
Reference No:- TGS02900704

Expected delivery within 24 Hours