Question: *PLEASE PROVIDE THE CODE FOR JAVA IN JGRASP AND USE JOPTIONPANE FOR OUTPUT* Scenario: DC Bus Tours has asked you to create a new application

*PLEASE PROVIDE THE CODE FOR JAVA IN JGRASP AND USE JOPTIONPANE FOR OUTPUT*

Scenario:

DC Bus Tours has asked you to create a new application that will keep track of their different bus tours. DC Bus Tours has 15 buses with a capacity of 50 general seats and 15 premium seats each.

Each Bus tour is tracked by a Bus Tour Identifier (must be 6 characters long with the first two being upper case characters and the last four being only digits), Name of the Bus, general ticket cost, and a premium ticket cost ($25 plus the general ticket cost). Additionally, each bus tour should track how many general seats and premium seats have been sold.

Create a program with a menu that allows a user to select one of the following options:

  1. Create Bus Tour This option will allow a user to create a new bus tour by entering all information about the bus tour, other than the premium ticket cost. However, if the maximum number of bus tours (15) has already been reached, an error message should display instead.
  2. Remove Bus Tour This option will allow a user to delete a bus tour from service. To enable this, the user must first see a list of all bus tours available. The user may then select which bus tour to delete. However, if the user chooses an invalid bus tour, or if there are no bus tour to choose from, the user should be provided with an error message.
  3. Sell Tour Ticket This option will allow a user to sell a ticket for one of the bus tours by selecting a bus tour and specifying if it is a premium class or general seat. If the user chooses an invalid bus tour, or if there are no seats available for the specified type, then user should be provided with an error message.
  4. Display Bus Tours This option will allow a user to view all information about all bus tours, including the number of tickets sold for each type and the money earned. However, if there are no bus tour created, the user should be provided with an error message.
  5. Exit the Program This option will provide a final report showing the current number of bus tours entered and total amount of money earned from selling tickets across all current bus tours (Note: Do not include bus tours that have been removed from service).

Upon completion of the action from the menu item, the user should be prompted to select another menu item. This will continue until the user has selected to exit the program.

Other Requirements:

  • You may assume a user will NOT enter two bus tours with the same ID and bus name.
  • Your solution must use object-oriented techniques (No points earned for a procedural solution).
  • Your solution must demonstrate use of arrays
  • Your solution must be designed as a modular solution using methods other than main, with each method performing one task.
  • Your solution must include appropriate constants, constructors, accessors, mutators, and special purpose methods (including a toString() method) with exception handling, as necessary in support of the problem.
  • Your solution must not import any Java library other than JOptionPane.
  • You may not use System.exit, or any variant that exits the program in the middle of the program. The program should only exit once the algorithm has finished completing.
  • Your solution may not use any functions or language constructs not covered during IT 106 or this semesters IT 206 without prior authorization from your instructor, even if you know other functions or language constructs. We want everyone to be on the same "playing field", regardless of previous programming exposure, and get practice with algorithmic design to solve problems (the intent of the course). Using something existing not discussed in class does not give you as much practice as solving the problem yourself. Doing this may lead to a substantial grade penalty, a grade of zero, or an Honor Code inquiry. When in doubt, ask!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!