(Solved) : Assignment 2 Question 100 Introduction Required Write Program Simulates Flight Booking Sys Q36971246 . . .

Assignment 2 Question (100) Introduction You are required towrite a program that simulates a flight booking system. A sampleprogram execution is provided at the end of the document, to helpyou visualize and understand what the program should do. You shoulduse the same input as the sample program, for the screenshots thatyou submit with your assignment. The flight route is fromJohannesburg to Cape Town with the travel duration fixed at 2 ½hours. o Departure and arrival locations remain the same. oDeparture is always from Johannesburg and destination is alwaysCape Town. The departure and arrival times are: Option DepartureTime Arrival Time 1 7:00 9:30 2 9:00 11:30 3 11:00 13:30 4 13:0015:30 5 15:00 17:30 The seating arrangement is six seats in a row,three on the left side and three on the right side of the planewith a walkway (passage) in between. See the image of the setupbelow. (image source:http://travelgurureviews.com/kulula-com-reviews/airline-reviews/ )o The total number of seats in the flight is 50. COS1511/103/1/20195 o There are two classes of travel: First Class and Economy class.o The front four rows are considered as ‘First Class’ and all otherrows to the back are ‘Economy Class’. o The cost for economy classis fixed at R 1 600.00. o The first class travel ticket is 20% morecostly than the economy class. Questions You are required to do thefollowing. (See the sample output screenshots for clarification).Write a program that will do the following: 1. Prompt (ask) theuser to enter his/her full name. 2. Then display a menu showing theavailable times for the flight.  The user can choose a preferreddeparture time (option 1 -5).  The option selected should bevalidated for 1-5. 3. If the user has entered a valid option, theseating arrangement for that particular flight time should bedisplayed to the user for the user to choose a seat. If any seatshave already been booked for that time, the booked seats should beindicated and displayed using “**”. Validation for time optionchosen COS1511/103/1/2019 6  The user can then choose a suitableseat number that is available.  The seat number should bevalidated to see if it has already been booked.  In other words,if the user enters a seat number that is already booked, display auser-friendly message and give the option to enter the seat numberagain. 4. Once the user has successfully chosen an available seat,a Flight booking ticket should be displayed on the screen.  Checkthe sample screenshot for the details that need to be displayed onthe ticket. 5. The program should prompt (ask) the user if theywould like to make additional bookings?  Then the program shouldbe able to repeat for more than one booking with various flighttimes.  The check for ‘y’ or ‘n’ at the “Do you want tocontinue(Y/N)?” prompt should be case-insensitive. In other words,both ‘Y’ and ‘y’ should be accepted or both ‘N’ and ‘n’ should beaccepted. Booked seats indicated with “**” COS1511/103/1/2019 7 6.When the user has finished all the booking and chosen ‘N’ or ‘n’ atthe “Do you want to continue(Y/N)?” prompt, the program shoulddisplay the total number of bookings made for each flight time,just before exiting. Submit the full program code and outputscreenshots. Include screenshots in your submission showing:  theprogram repeating;  input validations;  booking for differentflight times. You are required to define and use functions to dothe following:  Display the menu for flight times, accept the useroption and validate the user option. o Call the function tovalidate the menu option from here.  Validate the menu option forflight times.  Display the seating arrangement (You might have touse two different functions for seat display). o ie. before anybooking has been made, you have one seating arrangement with allthe seats available. After seats are booked, you have to displaythe booked seats with “**”).  Validate the availability of thechosen seat (to check if the seat has been already booked or not).o You DO NOT have to do validation for an invalid entry like Z3. Weassume that the user enters a valid seat number that is displayedon the screen. You only need to check if it has been already bookedor not.  Calculate the ticket price.(You are allowed to use aglobal named constant for the price of economy class, however,wherever you have to display the cost of ticket, you need to usethis function to determine the price of the ticket. o For instance,when you show the amount in the ticket that is displayed as outputfor each booking made.  Display the ticket, as shown in the sampleoutput, for each booking. The function used to calculate ticketprice can be called from this function. DO NOT use globalvariables. Except that you are only allowed to use global namedconstants for the following: o Cost of economy class ticket. o Anarray for storing departure times and arrival times. o For the sizeof any other arrays you might use. DO NOT use classes to write thisprogram (you should be able to write this program with the help ofother data structures that you have learnt). Additionalinformation/ Hints: o You need to store the details of a particularbooking, because you have to display the booked seats in theseating arrangement with “**”, when the program repeats. oTherefore, you need to think in the direction of storing thedetails of one booking which are of different data types, in oneplace. o Again, if you are making more than one booking, then youhave to store the details of various bookings in an array. Applywhat you have learnt and use appropriate data types and datastructures. The program should display the total bookings for eachtime, before exiting. COS1511/103/1/2019 8 o If you want to displaythe seat number as a combination of letter and number as in A1, A2etc, then you can use the to_string() function to convert theinteger to string and concatenate. For example: char row = ‘A’; intcol = 1; string sNo = “”; sNo += row; sNo += to_string(col); SampleProgram output (from one execution of the program without exiting):Validation for time option chosen COS1511/103/1/2019 9 Seats bookedshould be indicated with “**” Ticket display for a bookingCOS1511/103/1/2019 10 A1 was already booked for 7:00 am flight. Sodisplay an appropriate message that the seat has already beentaken. Two seats booked for 7:00 am flight COS1511/103/1/2019 11[TOTAL: 100 Marks] A

Expert Answer


Answer to Assignment 2 Question (100) Introduction You are required to write a program that simulates a flight booking system. A s…

Leave a Comment

About

We are the best freelance writing portal. Looking for online writing, editing or proofreading jobs? We have plenty of writing assignments to handle.

Quick Links

Browse Solutions

Place Order

About Us

× How can I help you?