-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGreatPyramidOfGiza.java
More file actions
47 lines (20 loc) · 1.02 KB
/
Copy pathGreatPyramidOfGiza.java
File metadata and controls
47 lines (20 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//Question 2.35
import java.util.Scanner;
public class GreatPyramidOfGiza {
public static void main(String[] args){
Scanner input = new Scanner(System.in);
System.out.print("Estimated number of stones used: ");
int numberOfStones = input.nextInt();
System.out.print("Average weight of each stone: ");
int weightOfEachStone = input.nextInt();
System.out.print("Number of years taken to build the pyramid: ");
int NnumberOfYears = input.nextInt();
int weightPerQuantityOfStones = numberOfStones * weightOfEachStone;
int forEachYear = weightPerQuantityOfStones * 1 / NnumberOfYears;
int forOneHour = forEachYear / 8760;
int forOneMin = forEachYear / 525600;
System.out.printf("The estimate of how much weight the pyramid was built each year is %dkg %n", forEachYear);
System.out.printf("The estimate of how much weight the pyramid was built each hour is %dkg %n", forOneHour);
System.out.printf("The estimate of how much weight the pyramid was built each minute is %dkg %n", forOneMin);
}
}