Java program to assign passengers seats in airplane

Assignment Help Data Structure & Algorithms
Reference no: EM1380181

Question: Prepare a Java program to assign passengers seats in an airplane. Suppose a small airplane with seats numbered as follows:

1 A B C D
2 A B C D
3 A B C D
4 A B C D
5 A B C D
6 A B C D
7 A B C D

The program should display the seat pattern, with an 'X' marking the seats already assigned. For example, after seats 1A, 2B, and 4C are taken, the display should look like:

1 X B C D
2 A X C D
3 A B C D
4 A B X D
5 A B C D
6 A B C D
7 A B C D

After displaying the seats available, the program prompts for the seat desired, the user types in a seat, and then the display of available seats is updated. This continues until all seats are filled or until the user signals that the program should end. If the user types in a seat that is already assigned, the program should ask for another choice.

 

Reference no: EM1380181

Questions Cloud

Comparison of the applicability of array : Data structures include: 1. a linked list, 2. an ordered, one dimensional array, and three. a binary tree. Assume the list of letters R, A, N, B, C, F, X and G are stored in a list.
Question about branch hazard : Provide a relevant example using MIPS instruction set architecture. Discuss the similarities and differences of the code will proceed it the branch is taken, vs if the branch is not taken, and explain how this affects the pipeline.
Creating two arrays of integers : Prepare two arrays of integers, each holding 10-elements of data. Make a third array of integers for a result array. The main program will take the 2-arrays of integers and pass them to the function subtract().
Creating an array : Determine which of the following commands is used to create an array?
Java program to assign passengers seats in airplane : Prepare a Java program to assign passengers seats in an airplane. Suppose a small airplane with seats numbered as follows:
Prepare a japplet with a jbutton : Prepare a JApplet with a JButton labeled Who is number one and when the user clicks on button, display your favorite sports team. Save the document as JNumberOne.java.
C program that accepts a month and day : Make a C program that accepts a month and day for example, June 14 from the keyboard as input. Store this data in a string called date.
Finding the values of queuefront and queuerear : Assume that queue is a queue type object and the size of the array-implementing queue is 100. Also, assume that the value of the queueFront is 25 and the value of queueRear is twenty-five.
Creating an automated checkout program : A local department store employee you to create an automated checkout program to expedite customers in a hurry. The checkout line can only allow 5-products for any one purchase.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write the implementation of a data structure

Write an implementation of a data structure S that supports the following operations: Insert(S, x): insert the key x into S only if it is not already there.

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Find the minimum cost path from a designated node

Find the Minimum Cost Path from a designated start node to a designated destination node in a graph.

  Write algorithm in pseudo code for bank account

Write an algorithm in pseudo code to settle following question: A bank account starts out with $10,000. Interest is compounded monthly at 6% per year(0.5% per month).

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Write efficient backtracking algorithm to inputs integers

Write efficient backtracking algorithm which inputs the integer N, and outputs all of the ways which a group of ascending positive numbers can be summed to N.

  Determining public keys for other party in sending message

Determine correct public keys for other party, and assuming that Eve can intercept any messages.

  C program that accepts a month and day

Make a C program that accepts a month and day for example, June 14 from the keyboard as input. Store this data in a string called date.

  Create a solution algorithm using pseudocode

Algorithm that will receive two integer items from a terminal operator, and display to the screen their sum, difference, product and quotient.

  Explain eager decision tree algorithm-lazy knn algorithm

Discuss the advantages and disadvantages of the new algorithm compared with the eager decision tree algorithm, and the advantages and disadvantages of the new algorithm compared with the lazy kNN algorithm.

  Write algorithm to decide which commute is cheaper

Write working algorithm in pseudo code to decide which commute is cheaper: You wish to decide whether you must drive your car to work or take train. You know one-way distance

  Important java questions

Add a method addText to the Question class, and provide a different implementation of Choice Question that calls add Text rather than storing an array list of selections.

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