Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE WRITE A JAVA CLASS Scenario: DC Bus Tours has asked you to create a new application that will keep track of their different bus

PLEASE WRITE A JAVA CLASS

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago