Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Q) write a c programm? Suppose you have been asked to develop a software for seat allocation for Pakistan Eagle Flight PE-49. The route is

Q) write a c programm?

Suppose you have been asked to develop a software for seat allocation for Pakistan Eagle Flight PE-49. The route is from Islamabad to Madinah. Assume, it has total 12 seats with numbers from 1 to 12. The seat numbers from 1 to 4 are in Business Class. All other seats are in Economy Class. The seat numbers (from 1 to 12) which are exactly divisible by 4 are on Window Side. The air fare for one ticket is Rs.90,000/= for the business class and Rs.54000/= for the economy class, respectively; however there is 2% extra charges for a window seat. Write a complete and an efficient C code that should, first of all, display the message: Welcome to Pakistan Eagle Flight PE-49 from Islamabad to Madinah. Your code then should ask the passenger to enter 1 for Business Class or 2 for Economy Class. According to the provided choice, display all the available seats in that class with the message The following seats are available, and then display message Please select the seat number of your choice. Your code should receive the selected seat number, then display the reservation message and the total fare as shown in the following sample output (for example): Your Seat No. 8 has been reserved. Total fare is Rs.90,000/=. Thanks to Fly with Pakistan Eagle. Have a Nice Journey. Your code should run again to ask the passenger to enter 1 for Business Class or 2 for Economy Class. Display the remaining available seats in that class with the message The following seats are available, and Please select the seat number of your choice. Your code should run repeatedly till the allocation of all the seats in Business and Economy Class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

Students also viewed these Databases questions