Write code to display a numbered list displayed with 2 decimal places. The output must be displayed with a heading and subheading as shown in the example that follows. List of Bookings Flight number 1 120 2 Number of seats 2 Price per ticket 12e0.ee 34ee.ee 1400.ee 13ee.ee 4500.ee Туре 2 125 159 3 4 113 167 2 E B

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

must be written in c++, the last part should be to write code to display the numbered list again to see whether the booking has been removed.

following:
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.
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.
Example of input:
Make a booking (Y or N)? :Y
Type of seat (E or B): e
Price per seat: 1200
Number of seats: 2
Make another booking (Y or N)? :y
Type of seat (E or B): b
Price per seat: 3400
Number of seats: 2
Make another booking (Y or N)? :y
Type of seat (E or B): e
Price per seat: 1400
Number of seats: 3
Make another booking (Y or N)? :y
Type of seat (E or B): e
Price per seat: 13ee
Number of seats: 2
Make another booking (Y or N)? :y
Type of seat (E or B): b
Price per seat: 4500
lumber of seats: 2
Make another booking (Y or N)2 :n
Transcribed Image Text:following: 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. 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. Example of input: Make a booking (Y or N)? :Y Type of seat (E or B): e Price per seat: 1200 Number of seats: 2 Make another booking (Y or N)? :y Type of seat (E or B): b Price per seat: 3400 Number of seats: 2 Make another booking (Y or N)? :y Type of seat (E or B): e Price per seat: 1400 Number of seats: 3 Make another booking (Y or N)? :y Type of seat (E or B): e Price per seat: 13ee Number of seats: 2 Make another booking (Y or N)? :y Type of seat (E or B): b Price per seat: 4500 lumber of seats: 2 Make another booking (Y or N)2 :n
Write code to display a numbered list with all the inrormation
displayed with 2 decimal places. The output must be displayed with a heading and subheading as shown in
the example that follows.
List of Bookings
Flight number
Number of seats
Price per ticket
1200.ee
34ee.ee
1400.ee
13ee.ee
450e.ee
Туре
2
120
125
1
2
2
3 159
4 113
5 167
E
E
2
B
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.
Example of output:
Income from bookings
Flight number
1 120
2 125
3 159
113
Type
E
Amount (R.c)
2400.ee
6Bee.ee
4200.ee
4
2600.ee
5 167
9e00.ee
Total number of economic seats booked: 7
Income from economic seat bookings:
Total number of business seats booked: 4
Income from business seat bookings:
Total income :
R 9200.e0
R 15800.ee
R 25000.ee
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.
the hankine hac heen removed
Transcribed Image Text:Write code to display a numbered list with all the inrormation displayed with 2 decimal places. The output must be displayed with a heading and subheading as shown in the example that follows. List of Bookings Flight number Number of seats Price per ticket 1200.ee 34ee.ee 1400.ee 13ee.ee 450e.ee Туре 2 120 125 1 2 2 3 159 4 113 5 167 E E 2 B 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. Example of output: Income from bookings Flight number 1 120 2 125 3 159 113 Type E Amount (R.c) 2400.ee 6Bee.ee 4200.ee 4 2600.ee 5 167 9e00.ee Total number of economic seats booked: 7 Income from economic seat bookings: Total number of business seats booked: 4 Income from business seat bookings: Total income : R 9200.e0 R 15800.ee R 25000.ee 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. the hankine hac heen removed
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Algebraic Expressions
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