public class lab2
{
public static void main(String[] args)
{
double mouse=5;
double mount=55;
double sodapop=100;
double sodapop1=500;
double weight=0.035;
double startingweight=60;
double finalweight=50;
System.out.println("The weight of this mouse is "+mouse+"kg");
System.out.println("A reasercher tells us that when mouse eats "+mount+"g sweetener and die");
System.out.println("When this mouse drank "+sodapop+"c.c and he lost "+weight+"kg");
System.out.println("When this mouse drank "+sodapop1+"c.c and he died");
System.out.println("*******************************************");
System.out.println("Tommy is "+startingweight+"kg ");
System.out.println("His desired weight is "+finalweight+"kg ");
System.out.println("He thinks that he can drink:");
System.out.println(sodapop1+"*"+startingweight+"/"+mouse+"="+sodapop1*startingweight/mouse+"c.c");;
double a=sodapop1*startingweight/mouse;
System.out.println("And when he loses:"+weight+"*"+a+"/"+sodapop+"="+weight*a/sodapop+ "kg");
System.out.println("He could not drink it anymore!!");
}
}
執行檔