38.3k views
4 votes
1.6.6 Night out for codehs

User Dorvalla
by
6.8k points

2 Answers

2 votes

Answer:

import java.util.*;

public class NightOut

{

public static void main(String[] args)

{

Scanner input = new Scanner(System.in);

double cost;

double cost2;

double cost3;

double grandtotal;

System.out.println("How much did dinner cost?");

cost = input.nextDouble();

System.out.println("How much is mini-golf for one person?");

cost2 = input.nextDouble();

System.out.println("How much did dessert cost?");

cost3 = input.nextDouble();

grandtotal = cost + cost2 * 2 + cost3;

System.out.println("Dinner: " + cost);

System.out.println("mini-golf: " + cost2);

System.out.println("Dessert: " + cost3);

System.out.println("Grand Total: " + grandtotal);

}

}

Step-by-step explanation:

Logic, jk

User Ethan Brouwer
by
5.7k points
2 votes

Answer:

import java.util.*;

public class NightOut

{

public static void main(String[] args)

{

Scanner input = new Scanner(System.in);

double cost;

double cost2;

double cost3;

double grandtotal;

System.out.println("How much did dinner cost?");

cost = input.nextDouble();

System.out.println("How much is mini-golf for one person?");

cost2 = input.nextDouble();

System.out.println("How much did dessert cost?");

cost3 = input.nextDouble();

grandtotal = cost + cost2 * 2 + cost3;

System.out.println("Dinner: " + cost);

System.out.println("mini-golf: " + cost2);

System.out.println("Dessert: " + cost3);

System.out.println("Grand Total: " + grandtotal);

}

}

Step-by-step explanation:

User Inderpal
by
6.5k points