2008年3月3日 星期一

Lab 2 Java for Scientific Computation



public class JAVA {
public static void main (String[] args)
{
int weight_of_mouse = 400;/*各個的體重*/
int weight_of_human = 75000;
int weight_of_strating = 75000;
int weight_of_desired = 70000;
double ratio_of_sweetener_to_soda = 0.001;
double sweetener_to_kill_a_mouse = 1;
double ratio_of_sweetener_to_mouse;
double sweetener_to_human;
double diet_soda_drink_in_safely_range;
System.out.println("某人想要減重所需減肥可樂的量"+"但是過多的代糖會導致死亡!!!");/*輸出"某人想要減重所需減肥可樂的量"+"但是過多的代糖會導致死亡!!!"*/
System.out.println("如果某人"+weight_of_strating/1000+"Kg");/*如果某人xx公斤*/
System.out.println("使用此方法所減的重量");
System.out.println("如果我們知道"+sweetener_to_kill_a_mouse+" g 可殺死1隻"+""+weight_of_mouse+"克的老鼠");
ratio_of_sweetener_to_mouse = sweetener_to_kill_a_mouse / weight_of_mouse;
sweetener_to_human = weight_of_human * ratio_of_sweetener_to_mouse;
diet_soda_drink_in_safely_range = sweetener_to_human / ratio_of_sweetener_to_soda;
System.out.println("一個人所能喝的量為"+sweetener_to_human+" g 的"+ "人工代糖");
System.out.println("如果一個成年人想使用減肥可樂,那他的量不應該超過:"+diet_soda_drink_in_safely_range/1000 + "公升");


}

}

沒有留言: