A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. You’re to write an application to assign seats on each flight of the airline’s only plane (the capacity of the plane is 10 seats of the same class). The flight ticket costs 500 $. Use a one-dimensional array of type Boolean to represent the seating chart of the plane. Initialize all the elements of the array to false to indicate that all the seats are empty. The user can choose his seat number (from 1 to 10) if it is available. As each seat is assigned, set the corresponding element of the array to true to indicate that the seat is no longer available. Your application should never assign a seat that has already been assigned. The baggage allowance is a single bag of 10 kg. Each extra kg is charged with 5 $. However, the weight of the bag should never exceed 20 kg. The reservation request of the customer should be rejected if his chosen seat number is not available and/or his baggage exceeds 20 kg and justified rejection message(s) should be alerted to the customer. Otherwise, a confirmation message that contains the customer’s seat number, extra weight fees, and total fees is alerted. The reservation process should continuously run for other customers until the user of the application explicitly ends it. At the end of the application, a summary of the number of reserved seats with total income should be alerted to the user.
nouran_2 0 Newbie Poster
rproffitt 2,662 "Nothing to see here." Moderator
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.