2005-09-28

Lab2-Project4

package lab2;
public class lab2
{
public static void main(String[] args)
{
double mouseweight=0.500;
double dieterweight=100.000;
System.out.println("\nAnyone loses 0.02 kg if drinking 100 c.c. soda, and will die if losing the weight over 60%.\n");
System.out.println("Now a mouse has "+mouseweight+" kg.\nIt will die if it loses over "+mouseweight*0.6+" kg.");
System.out.println("That is it can't drink over "+mouseweight*0.6/0.02*100+" c.c. soda.\n");
System.out.println("There is 1/10th of one percent artificial sweetener in the soda.\n");
System.out.println("In this way, a dieter has the weight of "+dieterweight+" kg, and losing less "+dieterweight*0.6+" is safety.");
System.out.println("So, he (or she) can't drink over than "+dieterweight*0.6/0.02*100+" c.c. soda.");
}
}


Anyone loses 0.02 kg if drinking 100 c.c. soda, and will die if losing the weight over 60%.


Now a mouse has 0.5 kg.
It will die if it loses over 0.3 kg.

That is it can't drink over 1500.0 c.c. soda.


There is 1/10th of one percent artificial sweetener in the soda.


In this way, a dieter has the weight of 100.0 kg, and losing less 60.0 is safety.

So, he (or she) can't drink over than 300000.0 c.c. soda.


=============

恩...
Java也有換行的/n
呵呵~~~^^

0 Comments:

張貼留言

<< Home