Classex For Loop

  • Uploaded by: david johnson
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Classex For Loop as PDF for free.

More details

  • Words: 250
  • Pages: 2
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).

Related Documents

Classex For Loop
November 2019 24
Classex While Loop
November 2019 12
Loop
October 2019 51
C5( If And For Loop)
October 2019 9
C-for-whle-loop-6
October 2019 9

More Documents from ""

Syll_fall_2008
November 2019 17
Acct 101 Syllabus
November 2019 27
Classex For Loop
November 2019 24
Jake S Client And Pet Data
November 2019 20
Mortgage Table
November 2019 18