Question: I'm stuck in creating this simple console application in visual studios C#. Any assistance I greatly appreciate. Not sure where to start. Narrative: A small

I'm stuck in creating this simple console application in visual studios C#. Any assistance I greatly appreciate. Not sure where to start.

Narrative: A small airline has just purchased a computer for its new automated reservations system. You have been asked to develop the new system. Youre to write an app to assign seats on each flight of the airlines only plane (capacity: 10 seats). Display the following alternatives (menu): Please enter 1 for First Class and Please type 2 for Economy. Enter 3 to exit (this is optional, but nice to have. Look at the TemperatureConverter for your inspiration) If the user types 1, your application should assign a first available seat in the first-class section (seats 15). If the user types 2, your application should assign a first available seat in the economy section (seats 610). Use a one-dimensional array of type bool 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 (actually it is default). 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! When the economy section is full, your application should ask the user if its acceptable to be placed in the first-class section (and vice versa). But first check if seats are available in another class! If the answer is yes, make the appropriate seat assignment. If no, display the message "Next flight leaves in 3 hours." Same message if all seats are reserved:"Next flight leaves in 3 hours."

I need to incorporate this code in the beginning.

private static int FIRST_CLASS_NUM_SEATS = 5; private static int ECONOMY_CLASS_NUM_SEATS = 5; //You can have just one array for 10 seats if you prefer so. private bool[] fseats = new bool[FIRST_CLASS_NUM_SEATS]; //FIRST class seats private bool[] eseats = new bool[ECONOMY_CLASS_NUM_SEATS]; //ECONOMY class seats 

public bool IsFirstClassAvailable() public bool IsEconomyClassAvailable() public bool[] GetAllSeats() public bool[] GetFirstClassSeats() public bool[] GetEconomyClassSeats() public int ReserveFirstClassAnySeat() public int ReserveEconomyClassAnySeat()

This is how it should display.

1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 You reserved first class seat 1 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 You reserved first class seat 2 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXITs 2 You reserved economy class seat 1 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 You reserved first class seat 3 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 You reserved first class seat 4 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 You reserved first class seat 5 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 FIRST class is full. ECONOMY class is still available. Do you want to reserve ECONOMY class? 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 2 You reserved economy class seat 2 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 2 You reserved economy class seat 3 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 FIRST class is full. ECONOMY class is still available. Do you want to reserve ECONOMY class? 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 1 FIRST class is full. ECONOMY class is still available. Do you want to reserve ECONOMY class? 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 2 You reserved economy class seat 4 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 2 You reserved economy class seat 5 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 2 This plane is full. Next flight in 3 hours. Goodbye! 1. Reserve FIRST Class 2. Reserve ECONOMY Class 3. EXIT 3 Thank you! Thank you for all your help. 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!