Rocky Blues program.
The Rocky Blues School offers personal blues guitar lessons for people in the Rockhampton region. The lessons are in half-hour blocks.
The cost of a lesson is $29.95.
To encourage students to book more lessons, the management has decided to give a ten per cent discount for a booking with more than five lessons and a twenty per cent discount with a booking of more than ten lessons on the total lesson charge (not for the purchase of a guitar see below).
Rocky Blues also offers the students a chance to purchase a guitar for $199.00.
You are to write a Java Console Application (RockyBlues.java) which will allow staff to enter the details of N booking names and the number of lessons and whether the student wants to purchase a guitar 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 lessons and clients for the booking, it will also prompt the student to ask if they want to purchase a guitar, it will then display the charge (see sample output below for formatting details).
When all the bookings have been entered you need to report the maximum and a minimum number of lessons per booking and the relevant booking name, the average number of lessons per booking and the total charges which have been collected.
The required Java Console Application should allow the user to:
- For each of the N bookings: enter the booking name, and then enter the number of lessons. The program will also prompt the user if the student wants to purchase a guitar (if “Y” or ”y” is entered then mark the student as wanting to purchase a guitar, any other response will assume no guitar is required). The program will output the charge for the booking. All dollar values will be formatted to two decimal places (see implementation below with help for doing this).
- You must ensure the booking name is not blank so you must implement a validation loop to ensure that a booking name is entered. For this assignment, there is no need to ensure the name is a valid name (e.g. entering 1 for the name would be allowed). The number of lessons must be greater than or equal to one and you will also need to implement a validation loop to ensure that a valid number of lessons is entered.
The program will number each booking in the input prompt.
- When N bookings have been entered, you will output a heading for the statistics “Statistical information for Rocky Blues”, the minimum and a maximum number of lessons booked and the booking names with these minimums and maximums, and then the average number of lessons per booking is (formatted to two decimal places) (see sample output below). Note: If more than one booking has an equal maximum or minimum lessons you just need to only output one of these cases.
- Display a welcome message at the beginning “Welcome to the Rocky Blues Management System” and an end message e.g. “Thank you for using the Rocky Blues Management System” and the final line “Program written by <your student ID>” (see sample output below).
The numeric literal values N, number of lessons for the different discount levels, discounts and lesson cost must be represented as constants.