1.
correct errors in the following program, assuming you want to print out 1 - 10: for (int count = 1; count<=10; count++;); { System.out.println(count); count++; }
2.
Convert the following while loop to a for loop: int count = 1; while (count <= 10) { System.out.println(“Hello World”); count++; }
3.
Convert the following for loop to a while loop: for (int x = 50; x>0; x--) { System.out.println(x + “Seconds to go.”); }
4.
Create a NetBeans project named Conversion that displays the following table (note that 1 mile is 1.609 kilometers): Miles 1 2 3 4 5 6 7 8 9 10
5.
Kilometers 1.609 3.218 4.827 6.436 8.045 9.654 11.263 12.872 14.481 16.09
Write a program named FutureInvestmentTable.java that lets the user enter the investment amount and period in number of years and displays the future value for each interest rate starting from 6% to 10%, with an increment of 0.5. Suppose you enter the loan amount 10000 for 10 years, display the table as the following: Please enter the investment amount: 10000 Please enter the number of years: 10 Interest Rate Future Value -------------------------------------------------------6.0% $18,193.97 6.5% $19,121.84 7.0% $20,096.61 7.5% $21,120.65 8.0% $22,196.40 8.5% $23,326.47 9.0% $24,513.57 9.5% $25,760.55 10.0% $27,070.41
6.
Write a program that reads in a sequence of hourly temperature readings beginning with midnight and prints the average temperature, the maximum temperature (along with the hour, on a 24 hour clock, it occurred) and the minimum temperature (along with the hour it occurred).