Question: How do I get this program to prompt me to enter cost of a cup? But do the rest of the math on its own?
MacOS - HelloWorldProjec foeCostCalculator.java- Eclipse IDE ) CoffeeCostCalculator java X 16//Progran nane: 2 //Author: 3 //Date: 4 I/Class 5 //Description: CoffeeCostCalculator erae. Cabrera Septenber 2 CSC 110 This program calculates the cost of coffee in a week and year. , 2818 10 package com.foo; 12 import java.utit.Scanner 13 14 public class CoffeeCostCalculator 15 t 16 pubtic static void sain(Stringt) args) 18 19 20 // Define all variable and assign values Scanner scanner new Scanner(System.in): 23 24 double singlecupcost 2.25; double costweekly Singlecupcost * 7; // assigned variables to the progran double CostYearly costweekly 52: 26 27 28 29 30 31 32 final int weeksInYear 52; // assign the constants the value that never change costweekly singlecupcost daysInweek; / the calculations to determine cost Costrearly costweek\ * weeks!nYear; 34 35 36 37 System. out.printIn Coffee Cost Calaculator: System.out.println" System.out.print(The Cost of one cup of coffee: s singlecupcost scanner.nextDouble); 39 System.out.print("The Cost of one week of coffee :$ ) costweekly scanner.nextDouble) 41 42 43 System.out.print( The cost of one year of coffee: s CostYearly scanner.nextDouble): 47 48 O Console 3 Probiems DDebug Shel CoverageJavadoo CoffeeCoCalculator lJava Application) Aibray/Javw/ JavavitualMachines/dk-10.0.2 jdauContents/+Home/bin)ave Sep 2,2018, 3:04:53 PM Coffee Cost Calaculator The Cost of one cup of coffee 2.25 The Cost of one week of coffee
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
