Question: public static void main ( String [ ] args ) { double billAmount; double nosofDiners; double totalBillAmount; Scanner s c n r = new Scanner

public static void main(String[] args){
double billAmount;
double nosofDiners;
double totalBillAmount;
Scanner scnr= new Scanner(
System.in);
billAmount = scnr. nextDouble ();
nosOfDiners = scnr. nextDouble();
System.out.println("Enter bill amount : "+ billAmount);
System.out.println("Enter number of diners : "+ nosofDiners);
System.out.println("Please consider the following tips:");
System.out.println("15%"+(billAmount *0.15)+"|");
System.out.println("Total bill: "+1.15* billAmount);
System.out.print("18%:"+(billAmount *0.18)+"|");
System.out.println("Total bill: "+1.18* billAmount);
System.out.print("20%"+(billAmount *0.20)+"|");
System.out.println("Total bill: "+1.20* billAmount);
System.out.println("Amount due from each diner based on tip percentage:");
System.out.println("Tip Amount 15% : "+(billAmount *1.15)/ nosofDiners +" due");
System.out.println("Tip Amount 18% : "+(billAmount *1.18)/ nosOfDiners +" due");
System.out.println("Tip Amount 20% : "+(billAmount *1.20)/ nosofDiners +" due");
 public static void main(String[] args){ double billAmount; double nosofDiners; double totalBillAmount;

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