Java语言程序设计 基础篇 原书第10版梁勇著 课后编程练习题答案2

1.8

public class Exercise01_08{
	public static void main(String[] args) {
	System.out.println(5.5 * 5.5 * 3.14159);
	System.out.println(2 * 5.5 * 3.14159);
	}
}

1.9

public class Exercise01_09 {
	public static void main(String[] args) {
	System.out.println(4.5 * 7.9);
	System.out.println(2 * (4.5 + 7.9));
	}
}

1.0

public class Exercise01_10 {
	public static void main(String[] args) {
	System.out.println((14 / 45.5) * 60 / 1.6);
	}
}

1.11

public class Exercise01_11 {
	public static void main(String[] args) {
	System.out.println(312032486 + 365 * 24 * 60 * 60 / 7.0 - 365 * 24 * 60 * 60 / 13.0 + 365 * 24 * 60 * 60 / 45.0);
	System.out.println(312032486 + 2 * 365 * 24 * 60 * 60 / 7.0 - 2 * 365 * 24 * 60 * 60 / 13.0 + 2 * 365 * 24 * 60 * 60 / 45.0);
	System.out.println(312032486 + 3 * 365 * 24 * 60 * 60 / 7.0 - 3 * 365 * 24 * 60 * 60 / 13.0 + 3 * 365 * 24 * 60 * 60 / 45.0);
	System.out.println(312032486 + 4 * 365 * 24 * 60 * 60 / 7.0 - 4 * 365 * 24 * 60 * 60 / 13.0 + 4 * 365 * 24 * 60 * 60 / 45.0);
	System.out.println(312032486 + 5 * 365 * 24 * 60 * 60 / 7.0 - 5 * 365 * 24 * 60 * 60 / 13.0 + 5 * 365 * 24 * 60 * 60 / 45.0);
	}
}

1.12

public class Exercise01_12 {
	public static void main(String[] args) {
	System.out.println(24 / (1 + (40 + 35.0 / 60) / 60) * 1.6);
	}
}

1.13

public class Exercise01_13 {
	public static void main(String[] args) {
	System.out.println("x is ");
	System.out.println((44.5 * 0.55 - 50.2 * 5.9) / (3.4 * 0.55 - 50.2 * 2.1)); 
	System.out.println("y is ");
	System.out.println((3.4 * 5.9 - 44.5 * 2.1) / (3.4 * 0.55 - 50.2 * 2.1));
	}
}

你可能感兴趣的:(Java语言程序设计 基础篇 原书第10版梁勇著 课后编程练习题答案2)