Enter a big number in minutes like 300000: 300000
300000 minutes consist of
6 months
28 days
8 hours
0 minutes.
Enter a day between 18 and 24: 19
It is Monday.
Enter two words divided by a blank space: Los Angeles
The words in alphabetical order are Angeles Los
Acres SquareFeet | SquareFeet Acres
———————————————————————–
1 43560 | 10000 0.230
2 87120 | 20000 0.459
3 130680 | 30000 0.689
4 174240 | 40000 0.918
5 217800 | 50000 1.148
6 261360 | 60000 1.377
7 304920 | 70000 1.607
8 348480 | 80000 1.837
9 392040 | 90000 2.066
10 435600 | 100000 2.296
Start with the following program and set up “for” or “while” loop to display as above.
public class Ch05_AreaConversion {
public static void main(String[] args) {
System.out.printf(“%15s%15s | %15s%15s\n”, “Acres”, “SquareFeet”,
“SquareFeet”, “Acres”);
System.out.println(“———————————————————————–“);
}
}
An example of data formatting is as follows.
System.out.printf(“Tuition will be $%10.2f in %5d years”, tuition, year);