Untitled
unknown
plain_text
14 days ago
1.2 kB
4
Indexable
Never
import java.util.*; public class NightOut { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("How much does dinner usually cost? "); double dinnerCost=input.nextDouble(); System.out.print("How much is laser tag for one person? "); double laserTagCost=input.nextDouble(); System.out.print("How much does a triple scoop cost? "); double tripleScoopCost=input.nextDouble(); // Multiply each cost by 2 double doubledDinnerCost=dinnerCost*=2; double doubledLaserTagCost=laserTagCost*=2; double doubledTripleScoopCost=tripleScoopCost*=2; // Display the doubled costs System.out.println("Dinner (for 2 people): " + doubledDinnerCost); System.out.println("Laser-Tag (for 2 people): " + doubledLaserTagCost); System.out.println("Triple Scoop (for 2): " + doubledTripleScoopCost); // Calculate grand total double grandTotal=doubledDinnerCost+doubledLaserTagCost+doubledTripleScoopCost; // Print the grand total System.out.println("Grand Total: " + grandTotal); // Close the Scanner } }
Leave a Comment