forked from erenuygur/EfficientHouseJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQ4.java
More file actions
36 lines (27 loc) · 1.25 KB
/
Q4.java
File metadata and controls
36 lines (27 loc) · 1.25 KB
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
26
27
28
29
30
31
32
33
34
35
36
package homeworks.chapter2;
public class Q4 {
public static void main(String[] args)
{
final double artificialSweetener = 0.001;
double mouseWeight = .3;
double killMouse = mouseWeight * 0.1;
double sodaCountForMouse = killMouse / artificialSweetener;
System.out.println(sodaCountForMouse);
double humanWeight = 20;
double sodaCountForHuman = humanWeight / mouseWeight * sodaCountForMouse;
System.out.println(sodaCountForHuman);
/* Solution 2
// Constant variables related to Mouse (Assuming, variables in kg)
double amountSweetenerToKillMouse = 0.0000013;
final double weightOfMouse = 0.03;
// Constant variables related to Dieter (Assuming, variables in kg)
double startingWeightDieter = 110.0;
double desiredWeightDieter = 85.0;
// Calculating the proportionate fatal amount of soda
double sodaForSafeUse = ((amountSweetenerToKillMouse / weightOfMouse) * desiredWeightDieter) / 0.001;
// Printing result to the screen
System.out.println("To lose " + (startingWeightDieter - desiredWeightDieter) + " kilograms.");
System.out.println("Safe soda limit to have: " + sodaForSafeUse);
*/
}
}