
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
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.

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

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps

Knowledge Booster
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
- Write algorithms to solve the problems given in each exercise. Note that you are NOT writing C++ code for this assignment. Please do not submit any code. The dealer's cost of a car is 85% of the listed price. The dealer would accept any offer that is at least $500 over the dealer's cost. Design an algorithm that prompts the user to input the list price of the car and print the least amount that the dealer would accept for the car.arrow_forwardIn C++arrow_forwardIn C++arrow_forward
- Exercise 3: Perform in C++ Write a program to simulate an experiment rolling two six sided "fair" dice. Allow the user to enter the number of rolls of the dice to simulate. What percentage of the time does the sum of the dots of the dice equal eight in the simulation?arrow_forwardWrite VBA CODE FOR THE FOLLOWING PROBLEM Problem: The Worksheet named Grades contains a place for students to record the grades they have received in their classes. Students put the number of each letter grade received in the B column. (For example, the worksheet currently shows that the student has taken 9 classes and made five As, one B, one C, one D, and one F as grades. You need to write a program that reads the grades from the worksheet and uses a function to calculate the student’s GPA. For this problem you can assume that all classes are worth the same number of credit hours. The function should send back the GPA to the calling procedure. The procedure will then put up a message box that gives the student their GPA and a message about their GPA, all in one message box. The message should be “You qualify for an internship” if the student has a GPA of at least 3.0. It should be “You’re in the danger zone” if the GPA is between 2.0 and 3.0. And it should be “You are on…arrow_forwardWithout using any string literal notation, how do you create the C++ statement that manually creates a null-terminated C-style string as an array of characters. Use the string “Sampson” as your example. Which element is stored in the base address of the array?arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education