Program should assign a seat in the first class

Assignment Help JAVA Programming
Reference no: EM13162683

You are to write a program to assign seats on each flight for an airline's only flight with a capacity of 80 seats (20 rows, and 4 columns).
Your program should display the following menu:
Enter 1 for first class, 2 for business class, 3 for economy class, 4 to display the available seats, and 5 to quit:
If a person enters 1, your program should assign a seat in the first class (rows 1 - 3). If a person enters 2, your program should assign a seat in business class (rows 4 - 7). If a person enters 3, your program should assign a seat in economy class (rows 8 - 20). If the seat is available at the given class, then the program should issue a boarding pass with the row and column number, and class type. If a customer asks for a class that is already full, then your program should ask the customer if it is okay to assign a seat in one of the other classes. If the flight is full, the program should print the message "This Flight is Full, Next Flight leaves in Three Hours".
Use a two dimensional array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longer available.
Your program should of course never assign a seat that has already been assigned.
You are required to write this program using functions. The prototype of your functions may look like as below or you may define them in any other way that you wish :
void MakeFirstClassReservation(int a[][4] );
void MakeBusinessClassReservation(int a[][4] );
void MakeEconomyClassReservation(int a[][4] );
bool IsFirstClassFull(int a[][4] );
bool IsBusinessClassFull(int a[][4] );
bool IsEconomyClassFull(int a[][4] );
void DisplayArray( int a[][4]);
etc.
If you define proper functions and use them in your main program, then your main program should not be complicated, and it will consist of small number of manageable statements.

Reference no: EM13162683

Questions Cloud

Required value for the move command : Shape_index is a required value for the move command. It is the index of the shape in the shape data arrays that you wish to move. It should range between 0 and MAX_SHAPES - 1. Be sure to validate the index.
Write a function that takes a list of integers as argument : Write a function that takes a list of integers as argument and returns a pair consisting of the sum of the even positions and the sum of the odd positions of the list. You should not use any auxiliary functions.
Receiver decide which symbol was originally sent : How can a receiver decide which symbol was originally sent when a received "point" lies somewhere in between other points in the diagram?
Program to translates a number into the closest letter grade : Write a program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade
Program should assign a seat in the first class : If a person enters 1, your program should assign a seat in the first class (rows 1 - 3). If a person enters 2, your program should assign a seat in business class (rows 4 - 7). If a person enters 3, your program should assign a seat in economy class ..
Write a version of sumpairs : Write a version of sumPairs  that sums each component of the pairs separately, returning a pair consisting of the sum of the first components and the sum of the second components. So basically [(3,1)(10,3)] would return (13,4).
The program reads in names : Write a program and include the following methods. The program reads in names and ages (use 2 parallel arrays, maximum size 50) from a file called Stuff.dat.
Design an adt for a two-color : Design an ADT for a two-color, double-stack ADT that consists of two stacks one "red" and one "blue" and has as its operations color-coded versions of the regular stack ADT operations.
How many moles of h2so4 must be present to react completely : How many moles of H2SO4 must be present to react completely with the NaOH delivered from the buret.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a program that converts number from binary to decimal

write a program that Converts a Number from Binary to Decimal  by using reading keyboard input.

  Write a program that shows the current time and date

Write a program that shows the current time and date

  Productexception class whose constructor

Create a ProductException class whose constructor receives a String that consists of a product number and price. Save the file as ProductException.java. Create a Product class with two fields, productNum and price. The Product constructor requires va..

  Implementation of encryption and steganography in java

This is a project report showing the essential details and coding structures related with the implementation of encryption techniques and steganography in JAVA.

  Create javascript program to find gross pay for employees

Create JavaScript program which will find out the gross pay for each of three employees. Company pays "straight time" for first 40 hours worked by each employee and pays "time and a half".

  Instance methods

instance methods: setWidth(double w), setHeight(double h), double getWidth(), double getHeight() and double getArea() * A triangle's area is calculated by width*height*0.5  * all variables are private and methods public.

  Prepare a java simulation program

Given a hash function h, prepare a java simulation program to determine each of the subsequent quantities after 0.8*tablesize random keys have been generated. The keys should be random integers.

  Write program in java-calculate and display mortgage payment

Write the program in Java (with a graphical user interface) and have it calculate and display the mortgage payment amount from user input of the amount of the mortgage.

  World data app

Prepare WorldDataApp project. It implements the NameIndex portion, including creating it in SetupProgram, and searching, viewing and updating it in UserApp program.

  Create bean jsp program which will compute simple interest

Create the bean which will compute Simple Interest. Use bean in JSP program. Accept details of saving like principal amount, rate of interest, period-in years from user and show amount

  Application that generates a quiz

Create an application that generates a quiz. Prompt for the user's first and last name, college major, and confidence in test taking (high, medium, or low). The quiz should contain at least five true/false questions about horticulture. When the user ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd