Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask HR Management Expert

Chapter 7 Two - Dimensional Array Lab

Change the program (AirlineDriver.java) to assign passenger seats in an airplane. Chesapeake Airlines is a small commuter airline with seats for 20 passengers in 5 rows of 4 seats each. Here is the layout:

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

The user enters the row (1 - 5) and the seat (A - D). The seat entry may be lowercase.

Use this code to enter the seat:

System.out.print(" Enter row and seat ");

seat = scan.nextLine();

 

r = seat.??

c = seat.??

What will you need to do to change r to a valid row entry?

What will you need to do to change the character (A, B, C, D) in the variable c to the column index in the array? Check the program example on page 347. I have included the LetterCount program in the Chapter Seven Activities.

The program checks the array to see if the seat is available. An X in the array indicates the seat is not available.

If the seat is available, assign an X to that position in the array. If it's unavailable, display a message to the passenger. Use the displaySeats method after each row/seat entry.

After some seats are assigned, the layout may look like this:

1 X B C X

2 A B C D

3 A X C X

4 A B C D

5 A B C D

Continue processing requests until the user enters -1 for seat.

HR Management, Management Studies

  • Category:- HR Management
  • Reference No.:- M91544923
  • Price:- $20

Guranteed 24 Hours Delivery, In Price:- $20

Have any Question?


Related Questions in HR Management

Question impressive writing please respond to the

Question: "Impressive Writing" Please respond to the following: Share an example of a strategic, professionally written, strategic communication piece. • Identify the key message. • Detail how the organization and compos ...

Question 1 why is it important that companies consider

Question: 1) Why is it important that companies consider becoming more global? 2) How can the HR function make the globalization effort more effective? The response must be typed, single spaced, must be in times new roma ...

Question 1 why does it seem that disasters are becoming

Question: 1) Why does it seem that disasters are becoming more frequent, more severe, and more expensive? What actions can be taken to reverse this trend? Discuss and provide examples. Your response must be at least 100 ...

Question many people have argued that the skills needed to

Question: Many people have argued that the skills needed to be successful in today's workforce have changed. What skills do you feel an individual needs to be successful in a job today? Why do you feel these skills are m ...

An employee has come to you with a request to take on a

An employee has come to you with a request to take on a part-time job. The employee would be working for Price Waterhouse as a contract employee during tax season. The employee has assured you that she will not work more ...

Question choose one article from the following website see

Question: Choose one article from the following website (see attached file) For the discussion, assess relevance to contemporary dining trends, determine accuracy/value, and either corroborate or refute the premise of th ...

Question for this assignment you will be asked to consider

Question: For this assignment you will be asked to consider workplace violence--its prevention and management. It seems that we are living in an age of increasing violence in our society and sometimes that violence spill ...

Johnson amp johnson and crisis management comparison of two

Johnson & Johnson and Crisis Management: Comparison of Two Leaders in Two Crises Abstract Crisis management communications is a critical skill for corporate leaders. Failure during crisis management may result in serious ...

Is there a responsibility or should organizationsleadership

Is there a responsibility or should organizations/leadership make a more concerted and visible effort to create opportunities for employees to separate themselves from the workplace? Some research suggests those who work ...

In december 2016 arshad ali joined imperial computers ltd

In December 2016, Arshad Ali joined Imperial Computers Ltd. (ICL) as a Senior Programmer, with a handsome pay. Prior to this job, he worked successfully as an assistant programmer in Gem Computers (Gem). Arshad felt that ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As