Lab2
package s9226307;public class s9226307 {
public s9226307() {
}
public static void main(String[] args) {
double mouse=5;
double amountsweetener=mouse;
double soadpop=1;
double loseweight=0.0001;
double sweet=soadpop*0.001;
double safedrink=amountsweetener*1000;
double person=100;
double safelose=person*0.1;
double desiredweight=person-safelose;
double peoplesafedrink=desiredweight*1000;
System.out.println("A mouse is "+mouse+" kg.");
System.out.println("The amount of artificial sweetener needed to kill a mouse is "+amountsweetener+" g.");
System.out.println(soadpop+" cc soda pop has "+sweet+" g artificial sweetener.");
System.out.println("Now drink soad pop "+soadpop+" cc can lose "+loseweight+" kg.");
System.out.println("A mouse must drink within "+amountsweetener*1000+" cc soad pop without dying.");
System.out.println("...............................Now discuss people...............................");
System.out.println("The starting weight of the dieter is "+person+"kg.");
System.out.println("So he must drink within "+peoplesafedrink+" cc soad pop without dying.");
System.out.println("So that he can lose "+safelose+" kg.");
System.out.println("Finally the desired weight of the dieter is "+desiredweight+" kg.");
}
}
0 Comments:
Post a Comment
<< Home