-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHw1prob8.java
More file actions
25 lines (19 loc) · 857 Bytes
/
Hw1prob8.java
File metadata and controls
25 lines (19 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//CSC110
//Professor Scheiman
//Jairo Molina
//Spring 2018
package hw1prob8;//DELETE THIS line if the program is not working.
import java.util.Scanner;//imports the java utility Scanner
public class Hw1prob8 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
double bagCookies = 40;//creates a variable type double
double calories = 300;//creates a variable type double
double user;//creates a variable type double
System.out.println("Enter how many cookies you have devoured: ");//displays string
user = scan.nextDouble();//scans cookies amount
double total = (user / 40)*10;//algorithm
double total2 = (total/1) *300;//algorithm
System.out.println("Total calories consumed: "+total2);//displays string
}
}