Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java Instructions You will be given a float variable called pricebetore Tax representing your restauraunt food bil. Compute the integer amount to pay, such that

java image text in transcribed
image text in transcribed
image text in transcribed
Instructions You will be given a float variable called pricebetore Tax representing your restauraunt food bil. Compute the integer amount to pay, such that the tip is at least 15% and the total price paid (the price after tax plus the tip is the exact dollar amount (no change used-other than possibly loonies and toonies!). Sales tax here in Nova Scotia (called HST) is 15% Write the body of the program Details Input The program reads in one float, the food bill amount priceBeforelax Processing Compute the minimum whole dollar amount to be paid such that the tip is at least 15%, and the total price paid the price after tax plus the tip) is an even dollar amount. Output the tip that wil ultimately be paid Output Output the total price to be paid as an integer. The text must be terminated by a new-line character Hints: Math.ceil(*) returns the smallest integer double that is greater than or equal to x, It sounds up to the nearest Integer above IEG. Math.ceil(19.53) so returns 20 ) To cast a double y to an integer, remember that you can use (int)y Examples Sample Input 15% tip Price after tax Sample Output (Amount Paid) 1.00 0.15 1.15 2 10 1.50 11.50 13 100 15.00 115.00 130 import java.util.*; * The following is the only class of the program and contains all program code. The program starts running in the main of this class. public class POD { * Main method that runs when the program is started. public static void main(String[] args) { //Instantiate new scanner to read from the console. Scanner in = new Scanner System.in); //Declare & initialize variables float priceBeforeTax = in.nextFloat(); //PLEASE START YOUR WORK HERE //PLEASE END YOUR WORK HERE System.out.print("END OF OUTPUT"); } 31

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What is DDL?

Answered: 1 week ago