Additional Notes: USING C# You cannot add two flights with the same flight number When you select “View Flights”, a list containing the Flight number, origin and destination for each flight must be shown. When you select “View a particular flight”, a list of all flights should be displayed and the user must be allowed to enter a particular flight number. All the information on that selected flight must be displayed. All the customers who are booked on that flight must SPECIAL NOTE: A customer can only be deleted if there are no bookings for that customer. A flight can only be deleted if there are no customers booked on the flight. You must extend the core design and add the functionality to add customers and booking features to the system. The information that must be recorded on a customer is as follows: A customer ID must be assigned to each customer by the system. (NOT entered by the user) The customer’s first name The customer’s last name. The customer’s phone (a string type is fine for this) The number of bookings the customer has made Your main menu should have the new options: Make booking View bookings ADD CUSTOMER When the “Add Customer” option is selected, all information necessary to make the customer object must be asked for. A customer can only be added if there is no other customer with the same first name, last name and phone number (all three cannot be the same). An appropriate message as to whether the customer addition was successful or not should be displayed. VIEW CUSTOMERS When “View Customers” is selected, the first name, last name and phone number must be displayed for each customer. The information that must be recorded on a booking is as follows: The date of the booking ( a string) A booking number must be assigned by the system. (NOT entered by the user) The flight object the booking is being made for. The customer object the booking is being made for Note : you can use the following code to get the date and time from your system as a string… string date = DateTime.Now.ToString(@"MM\/dd\/yyyy h\:mm tt"); Your main menu should have the new options: Make booking View bookings MAKE BOOKINGS When the “Add booking” option is selected, a list of all customers and all flights should be displayed first. The user must then be asked for the Customer id and flight id to make the booking for. A booking can only be made if there is free space on the plane, the customer id exists and the flight id exists. All associated objects should be updated. An appropriate message as to whether the booking was successful or not should be displayed. VIEW BOOKINGS When “View bookings” is selected, the date, booking number, customer name and flight number must be displayed for each booking.
Control structures
Control structures are block of statements that analyze the value of variables and determine the flow of execution based on those values. When a program is running, the CPU executes the code line by line. After sometime, the program reaches the point where it has to make a decision on whether it has to go to another part of the code or repeat execution of certain part of the code. These results affect the flow of the program's code and these are called control structures.
Switch Statement
The switch statement is a key feature that is used by the programmers a lot in the world of programming and coding, as well as in information technology in general. The switch statement is a selection control mechanism that allows the variable value to change the order of the individual statements in the software execution via search.
Additional Notes:
USING C#
- You cannot add two flights with the same flight number
- When you select “View Flights”, a list containing the Flight number, origin and destination for each flight must be shown.
- When you select “View a particular flight”, a list of all flights should be displayed and the user must be allowed to enter a particular flight number. All the information on that selected flight must be displayed. All the customers who are booked on that flight must
SPECIAL NOTE:
A customer can only be deleted if there are no bookings for that customer.
A flight can only be deleted if there are no customers booked on the flight.
You must extend the core design and add the functionality to add customers and booking features to the system.
The information that must be recorded on a customer is as follows:
- A customer ID must be assigned to each customer by the system. (NOT entered by the user)
- The customer’s first name
- The customer’s last name.
- The customer’s phone (a string type is fine for this)
- The number of bookings the customer has made
Your main menu should have the new options:
- Make booking
- View bookings
ADD CUSTOMER
When the “Add Customer” option is selected, all information necessary to make the customer object must be asked for.
A customer can only be added if there is no other customer with the same first name, last name and phone number (all three cannot be the same). An appropriate message as to whether the customer addition was successful or not should be displayed.
VIEW CUSTOMERS
When “View Customers” is selected, the first name, last name and phone number must be displayed for each customer.
The information that must be recorded on a booking is as follows:
- The date of the booking ( a string)
- A booking number must be assigned by the system. (NOT entered by the user)
- The flight object the booking is being made for.
- The customer object the booking is being made for
Note : you can use the following code to get the date and time from your system as a string…
string date = DateTime.Now.ToString(@"MM\/dd\/yyyy h\:mm tt");
Your main menu should have the new options:
- Make booking
- View bookings
MAKE BOOKINGS
When the “Add booking” option is selected, a list of all customers and all flights should be displayed first. The user must then be asked for the Customer id and flight id to make the booking for.
A booking can only be made if there is free space on the plane, the customer id exists and the flight id exists. All associated objects should be updated. An appropriate message as to whether the booking was successful or not should be displayed.
VIEW BOOKINGS
When “View bookings” is selected, the date, booking number, customer name and flight number must be displayed for each booking.
Step by step
Solved in 3 steps with 3 images