星期二, 9月 27, 2005

LAB2

public class lab2_4
{
public static void main(String[] args)
{

double mice=5;
double weight=0.02;
double Sweet=50;
double Sweetener=1;
double soda=1000;
double startingW=50;
double finalingW=40;
System.out.println("Nice diet lose weight");
System.out.println(" if the soda pop have " +Sweetener+ "g of " +soda+ "g soda pop." );
System.out.println(" mice weight = " +mice+ "kg," + " drank" +Sweet+ "g Sweetener's will lose " +weight*Sweet+ "kg and die.");
System.out.println(" and mouse drank " +soda*Sweet+ "c.c soda pop.");
System.out.println("Then we use for person......");
double a=(startingW/mice);
double Sweet2=Sweet*a;
System.out.println("if person weight " +startingW+ "kg ,if he drank " +Sweet2+ "g Sweetener's will lose " +weight*Sweet2+ "kg and die.");
System.out.println("and he drank " +soda*Sweet2+ "c.c soda pop.");
}
}
  • 程式執行完成連結
  • 0 Comments:

    張貼留言

    << Home