Reference no: EM13876400
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.
Create a class called student
: Java Create a class called Student that contains: - A field to store the name - A field to store their average numerical grade
|
Assume poisson properties apply
: Leaks occur along a pipeline at the mean rate of 0.5 leaks per mile. Assume Poisson properties apply. What is the probability that a 3 mile stretch will have no leaks? (to four decimal places)
|
Value bond outstanding with coupon rate
: Yan Yan Corp. has a $10,000 par value bond outstanding with a coupon rate of 5.2 percent paid semi annually and 28 years to maturity. The yield to maturity on this bond is 4.3 percent. What is the price of the bond?
|
In a method named setfavoritesports declare
: In a method named setFavoriteSports declare the sports array and populate it. This method will return the sports array to the calling statement. The 9 in the prompt below will print 1 for the first sport, then 2 for the 2nd one and so forth. Use t..
|
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:
|
East and west. bmi has a cost of capital
: Back Mountain Industries (BMI) has two divisions: East and West. BMI has a cost of capital of 15%. Selected financial information (in thousands of dollars) for the first year of business follows:
|
Provide a dollar estimate of the annual cost savings
: Provide a dollar estimate of the annual cost savings associated with the recently enacted quality improvements. Show calculations.
|
Did anyone different get admitted
: Is this enough information to determine who should get into the University? If not what other information would you want and why
|
Estimate financial benefits associated with adoption of jit
: You have been asked, in conjunction with your position as the management accountant for the company, to construct an Excel spreadsheet that can be used to estimate the financial benefits associated with the adoption of JIT.
|