Question: Learning Objectives Learning objectives and skills that students will demonstrate by taking the exam: Basic Java Programming Concepts: Students should demonstrate an understanding of basic

Learning Objectives
Learning objectives and skills that students will demonstrate by taking the exam:
Basic Java Programming Concepts: Students should demonstrate an understanding of basic Java syntax, including variable declaration, conditional statements, and input/output operations.
Conditional Statements and Control Flow: Students should be able to use conditional statements (if-else) to determine the rate based on the type of session selected by the user.
Input Validation: Students should validate user input to ensure it falls within specified ranges.
Mathematical Operations: Students should perform mathematical operations to calculate the duration of the session in hours and the charges for the session.
String Comparison: Students should compare strings to check if the discount code entered by the user matches the predefined discount code.
Output Formatting: Students should format output messages to display session information, rates, charges, discounts, and total amounts due in a clear and organized manner.
Special Instructions
You will have 3 hours to complete the assignment. The assignment is actually 2.5 hours but 30 minutes have been added to cover potential problems, allow for uploading, and capturing a screenshot of the submission confirmation page.
Use jGrasp to code this program.
Use the Scanner class.
Submit one file: your Java source code file (this is the file with the ".java" extension - NOT the ".class" file). Name the file: Exam1Lastname (replace with your last name). There will be a five-point deduction if filename is incorrect.
You can only submit twice. The last submission will be graded.
This exam covers concepts in Chapters 2 & 3 only. The use of advanced code not covered in Chapters 2 & 3 will count as a major error per instance.
Program Description
A local spa offers massages for individuals and couples. The spa charges different hourly rates based on the type of massage, where an individual massage costs $52.25 per hour and couples massages cost $176.55 per hour. Write a Java program that calculates the bill for a massage session at the spa. The program must:
Ask the user to select the type of massage session (individual or couples).
If an invalid session type is entered, the rate for an individual session will be applied by default.
Prompt the user to enter the duration of the massage session in minutes. The spa requires users to book a minimum of 35 minutes for a session. The maximum duration allowed for a session is 110 minutes.
If an invalid duration is entered, a standard session length of 45 minutes will be booked automatically.
Calculate the duration of the session in hours. The spa charges 1 hour for every 35 minutes of a massage duration.
Offer a special 25% discount for users who enter the discount code: RELAX25FALL. Prompt the user to enter the discount code.
If no discount code or an invalid discount code is entered, no discount will be applied.
Calculate the charge for the massage session. The amount due is the product of the total hours of the session and the hourly rate based on the type of massage session. Apply the discount code as necessary to the charge.
Display the type of session, the duration of the session in hours, the hourly rate for the session, the subtotal (session charge before discount), the discounted amount (if applicable), and the final amount due for the session.

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 Programming Questions!