Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the price of a seat in economic class and the number of seats booked. Declare an array to store at least 30 Booking structs. (4) 2. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether a booking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated. The user must be asked to enter the type of seat, the price per seat and the number of seats to book. 3. Write code to display a numbered list with all the information of all the bookings. The price per ticket must be displayed with 2 decimal places. The output must be displayed with a heading and subheading  4. Write code to calculate and display the income earned per booking. Display headings and subheadings. Also count and display the number of business seats and economics seats booked as well as the income earned from each of these types of bookings. Calculate and display the total income. 5. The user must be able to remove a booking from the list. Ask whether the user wants to remove a booking. If the user wants to remove a booking, the user must enter the number of the booking to be removed from the list. Use a do … while loop to validate the number that is entered. The number that was entered must be in the range of numbers displayed on the numbered list. In this example the number must be in the range of 1 to 5. If the number that was entered is not in the correct range, display an error message and ask the user to enter another number until a valid number has been entered. The validation must work for any number of bookings as displayed on the numbered list. Write code to display the numbered list again to see whether the booking has been removed.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

1. Create a struct called Booking that consists of a 3 digit flight number (e.g. 234), type of seat (E or B), the price
of a seat in economic class and the number of seats booked.
Declare an array to store at least 30 Booking structs. (4)
2. The user must be able to enter the information for a number of bookings from the keyboard. Ask whether a
booking must be made (Y or N). If a booking must be made, a random 3 digit flight number must be generated.
The user must be asked to enter the type of seat, the price per seat and the number of seats to book.
3. Write code to display a numbered list with all the information of all the bookings. The price per ticket must be
displayed with 2 decimal places. The output must be displayed with a heading and subheading 

4. Write code to calculate and display the income earned per booking. Display headings and subheadings.
Also count and display the number of business seats and economics seats booked as well as the income
earned from each of these types of bookings. Calculate and display the total income.

5. The user must be able to remove a booking from the list. Ask whether the user wants to remove a booking. If
the user wants to remove a booking, the user must enter the number of the booking to be removed from
the list.
Use a do … while loop to validate the number that is entered. The number that was entered must be in the
range of numbers displayed on the numbered list. In this example the number must be in the range of 1 to 5.
If the number that was entered is not in the correct range, display an error message and ask the user to
enter another number until a valid number has been entered. The validation must work for any number of
bookings as displayed on the numbered list.
Write code to display the numbered list again to see whether the booking has been removed.

 

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education