Question
Hello, I need help with this problem. Its a C# assignment. These are the instructions: This is basically the same exercise as A6-Ex4 Airline Reservation
Hello, I need help with this problem. Its a C# assignment. These are the instructions:
This is basically the same exercise as A6-Ex4 Airline Reservation with GUI with required methods to implement. Optional, but encouraged to implement. Use only one button and two radio buttons to select First Class or Economy (research radiobutton yourself). On load, make radio button Economy selected (default). You will use only one button Reserve that should be disabled after all seats are reserved. You must have these methods implemented (you can have other methods, they are up to you): ///Returns true is the First class is Available (at least one seat) public bool IsFirstClassAvailable() ///Returns true is the Economy class is Available (at least one seat) public bool IsEconomyClassAvailable() ///Display all seats after each selection public void DisplayAllSeats() ////Returns a boolean array with true elements for reserved seats and false for available for the first class public bool[] GetFirstClassSeats() ////Returns a boolean array with true elements for reserved seats and false for available for the economy class public bool[] GetEconomyClassSeats() ///(Optional) Returns a boolean array with true elements for reserved seats and false for available for the first and economy classes public bool[] GetAllSeats() ///Reserves the first available (important!) seat in the first class, for example, seat 3. ///Reserving the seat 1 will return 0. ///If no seats available, return -1. ///This method should be preceded with IsFirstClassAvailable() public int ReserveFirstClassAnySeat() ///Reserves the first available (important!) seat in the economy class, for example, seat 3. ///Reserving the seat 1 will return 0. ///If no seats available, return -1. ///This method should be preceded with IsEconomyClassAvailable() public int ReserveEconomyClassAnySeat()
This is the code I have so far:
namespace Airline_Reservation_with_GUI { public partial class Form1 : Form {
private static int FIRST_CLASS_NUM_SEATS = 5; private static int ECONOMY_CLASS_NUM_SEATS = 5; private static int totalTickets = 1;
bool[] fseats = new bool[FIRST_CLASS_NUM_SEATS];
bool[] eseats = new bool[ECONOMY_CLASS_NUM_SEATS];
string choice; int fCount = 1; int eCount = 1;
public Form1() { InitializeComponent(); } public int GetAllSeats()
{
return FIRST_CLASS_NUM_SEATS + ECONOMY_CLASS_NUM_SEATS;
} private void radioButton1_CheckedChanged(object sender, EventArgs e) {
}
private void radioButton2_CheckedChanged(object sender, EventArgs e) {
}
private void btnReserve_Click(object sender, EventArgs e) {
}
private void btnExit_Click(object sender, EventArgs e) { this.Close(); } } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started