Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

TAF4:21 T 100% oo AT&T; public asu.edu ASU CSE 110 Assignment #7 Due date/Time:

ID: 3816271 • Letter: T

Question

TAF4:21 T 100% oo AT&T; public asu.edu ASU CSE 110 Assignment #7 Due date/Time: Friday, April 14, 2017 at 5:30pm What this Assignment is About: Given a UML diagram, learn to design a class. Leam how to define, intialize and fill a two dimensional array. Leam how to traverse and access a two dimensional array. File provided AssignmentZjava Coding Guidelines for All LabsAssignments Oou will be graded on this) Give identifiers semantic meaning and make them easy to read (examples numStudents, gross Pay, etc). Keep identifiers to a reasonably short length. Use upper case for constants. Use title case (first letter is upper case) for classes. Use lower case with uppercase word separators for all other identifiers (variables, methods, objects). Use tabs or spaces to indent code within blocks (code surrounded by braces). This includes classes, methods, and code associated with ifs, switches and loops. Be consistent with the number of spaces or tabs that you use to indent. Use white space to make your program more readable. Use comments properly before or after the ending brace of classes, methods, and blocks to identify to which block it belongs. Assignment description In this assignment, you will need to write programs that help boat ride companies in Maine to sell boat ride tickets to tourists, Below please find the specifications: Assume that each siteseeing boat has 8 rows, with 6 seats in each row. To represent the seats, the BoatRideManager class should have a two-dimensional array of String as the underline data structure (see the following UML); we use "O (big oh with one empty space to its right to reprent that a seat is available (or empty) and use "E (hex with one empty space to its right) to represent itis already occupied (or sold Meanwhile, to simplify the task, we assume that the ticket's price is S35.0 per person, no matter what is the s age At the very beginning, a boat is always empty, i.e. all the 48 seats should be set to "O but after the program runs, some seats might be sold out and the seats become Seats 1 2 3 4 5 6 Row 1 O O O O O O Row 2 O O O O O O Row 3 O O O O O O Row 4 O O O O O O Row 5 O O O O O O

Explanation / Answer

Boat ride manager and driver program for given problem statement are mentioned below. I believe the program would be self explanatory when read along with the problem statement steps.

File: BoatRideManager.java

File: Assignment7.java (driver program)

Sample Execution Output:

Lulu Boat Ride Online Purchase System

Choose an Action
---------------------------------------
D: Display Seats Map
P: Purchase Boat Ride Ticket
S: Display Sales Report
?: Display the menu again
Q: Quit this program

Please enter a command: D
Seats
1 2 3 4 5 6
Row 1 O O O O O O
Row 2 O O O O O O
Row 3 O O O O O O
Row 4 O O O O O O
Row 5 O O O O O O
Row 6 O O O O O O
Row 7 O O O O O O
Row 8 O O O O O O

Please enter a command: P

Number of seats desired (1 - 6): 3

Desired row (1 - 8): 4

Desired starting seat number in the row (1 - 6): 2

The seats you have requested are available for purchase.

The total purchase price will be: 3 seats X $35.0 = $105


Do you wish to purchase these tickets (Yes/No)? Yes

The seats you have requested are available for purchase.

The total purchase price will be: 3 seats X $35.0 = $105

Please input amount paid: $200
Tickets purchased : 3
Payment : $200.0
Total ticket price: $105.0
Change due : $95.0

Please enter a command: D
Seats
1 2 3 4 5 6
Row 1 O O O O O O
Row 2 O O O O O O
Row 3 O O O O O O
Row 4 O # # # O O
Row 5 O O O O O O
Row 6 O O O O O O
Row 7 O O O O O O
Row 8 O O O O O O

Please enter a command: S
Lulu Lobster Boat Ride Sales Report
===================================
Seats sold: 3
Seats available: 45
Total revenue to date: $105.0

Please enter a command: Q