Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Problem: Tip Calculator Description: 2.5 (Financial application: calculate tips) Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and
Problem: Tip Calculator Description: 2.5 (Financial application: calculate tips) Write a program that reads the subtotal and the gratuity rate, then computes the gratuity and total. For example, if the user enters 10 for subtotal and 15 for a 15% gratuity rate, the program calculates $1.50 as the gratuity and $11.50 as the total. You must format the gratuity and total amounts using the technique shown in Canvas: Files > Week 01> NumberFormatExample.java. Finally, create only ONE Scanner object to accept input from the user. You should only ever create one Scanner object in your program when accepting input from the user. Program name: Lab01.java Sample Runs: Enter the subtotal and a gratuity rate: 1015 The gratuity is $1.50 and total is $11.50 Enter the subtotal and a gratuity rate: 10010 The gratuity is $10.00 and total is $110.00 Enter the subtotal and a gratuity rate: 15015 The gratuity is $22.50 and total is $172.50
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started