edumeister_logo

import java.util.Scanner; //import scanner class tshowing page 1 out of 1

import java.util.Scanner; //import scanner class to allow user input
public class Assignment1 //name of public class
{
public static void main (String[] args) //main method
{
Scanner in = new Scanner(System.in); //calls scanner from java.util
double bill_Amount, tip_Amount, total_Bill = 0; //Declared double
variables due to decimals in money
System.out.print("Enter the bill amount:"); //prompts user for
input
bill_Amount = in.nextDouble(); // Takes user input with scanner
class and stores it to double bill_Amount
System.out.print("What Percent would you like to tip:"); //prompts
user for input
tip_Amount = in.nextDouble(); //Scans for user input again
total_Bill = bill_Amount + ((tip_Amount/100)*bill_Amount); //
multiplies bill * tip/100 and stores it to total_bill
System.out.println("The total bill comes:" + total_Bill);
//displays total bill
}
}