Java Console program

Questions

Nemo Reef Tours program
Nemo Reef Tours is company which takes passengers on a tour of the Great Barrier Reef, the tours depart at 8:00 am and returns around 5:00 pm. A smorgasbord lunch is also provided along with the opportunity to snorkel among the exotic fish and coral.
This program will allow staff at Nemo Reef Tours to compute the cost of a group of passengers to take the tour. There is a flat fee of eighty five dollars and fifty cents ($85.50) per person.
The management of Nemo Reef tours would like to encourage more passengers to take the tour, so it was decided there would be discounts for a larger number of passengers in the booking group. The discounts are as follows:
Charge per person $85.50 (as above).
One to two passengers: no discount.
From three to five passengers: 10% discount.
From six to ten passengers: 15% discount.
More than ten passengers: 20% discount.
The Nemo Reef Tours management has asked you to write a program to help employees determine the charges for booking a tour and to also produce some statistics.
You are to write a Java Console Application (NemoReefTours.java) which will allow employees to enter the details of N booking names and the number of passengers for each booking. N should be equal to the highest digit in your student ID, use N=3 if your highest digit is less than three. For each booking the program will prompt for and accept the booking name and the number of passengers for the booking, it will then display the charge (see sample output below for formatting details).
For simplicity the bookings will be for the following day. When all the bookings have been entered you need to report the maximum and minimum number of passengers per booking and the relevant booking name, the average number of passengers per booking and the total charges which have been collected.
The required Java Console Application should allow the user to:

  1. For each of the N bookings: enter the Booking name, and then enter the Number of passengers.The program will output the charge for the booking. All dollar values will be formatted to twodecimal places (see implementation below with help for doing this).
  2. You must ensure the booking name is not blank so you must implement a validation loop so abooking name is entered. The number of passengers must be a positive number (non-zero) andyou will also need to implement a validation loop so valid number of passengers are entered.
    The program will number each booking in the input prompt.
  3. When N bookings have been entered, you will output a heading for the statistics “Statisticalinformation for Nemo Reef Tours”, the minimum and maximum number of passengers in thebooking groups and the booking name with these minimums and maximums, and then what theaverage number of passengers per booking is (formatted to two decimal places) (see sampleoutput below). Note: if more than one booking has an equal maximum or minimum passengersyou just need to only output one booking name.
  4. Display a welcome message at the beginning “Welcome to the Nemo Reef Tour ManagementSystem” and an end message e.g. “Thank you for using the Nemo Reef Tour ManagementSystem” and the final line “Program written by ” (see sample output below). The numeric literal values N, number of passengers for the different discounts and discountsmust be represented as constants.

Solution:

Java Console Program:-Code:-public static void main(String[] args) { // TODO code application logic here String name1="" ,minName = "", maxName = ""; DecimalFormat f = new DecimalFormat("##.00"); int numP=0, numBooking, count=0; double TotalPrice =85.50,AvrageP = 0, TotalAmount =0;System.out.println("Welcome to the Nemo Reef Tours Managment System\n");Scanner sc = new Scanner(System.in);

To Get Solution

Please put your valid email id

Plagiarism Checker

NEW YEAR OFFER 50% OFF !!! Order Now

NEW YEAR OFFER 50% OFF !!

Lets take Best opinion from our Expert Tutors Today! Order Now