Programming Problems Using Loop Constructs


Problem: Ten Even Integers

Write a JAVA program that will display the first ten even integers, beginning with 2, in ascending order.

Algorithm
Solution
Output

Problem: Multiples of 3

Write a JAVA program that will display all multiples of 3, from 3 to 300, inclusive.

Algorithm
Solution
Output

Problem: Multiples of 7

Write a JAVA program that will display all multiples of 7, from 7 to 700, inclusive.

Algorithm
Solution
Output

Problem: Even Integers From Two To Fifty

Write a JAVA program that will display the numbers between 2 and 50.

Algorithm
Solution
Output

Problem: Display Even Integers From Fifty To Two

Write a JAVA program that will display the numbers between 50 and 2, inclusive, in reverse order (beginning with fifty, and going to 2).

Algorithm
Solution
Output

Problem: Display Values From First User Input Value To Second User Input Value (ex. 1, ascending)

Prompt the user to input two values, a start value and an end value. The program is to display all the values from the start value to the end value, inclusive. (You may assume the start value entered by the user is less than or equal the end value).

Algorithm
Solution
Output

Problem: Display Values From First User Input Value To Second User Input Value (ex. 2, ascending, testing input values)

Prompt the user to input two values, a start value and an end value. The program is to display all the values from the start value to the end value, inclusive, in ascending order. (You SHOULD NOT assume that the start value entered by the user is less than or equal the end value).

Algorithm
Solution
Output

Problem: Display Values From First User Input Value To Second User Input Value (ex. 3, descending, testing input values)

Prompt the user to input two values, a start value and an end value. The program is to display all the values from the start value to the end value, inclusive, in descending order. (You SHOULD NOT assume that the start value entered by the user is less than or equal the end value).

Algorithm
Solution
Output

Problem: Display Multiples of 7 From First User Input Value To Second User Input Value (ascending, testing input values)

Prompt the user to input two values, a start value and an end value. The program is to display all multiples of 7 from the start value to the end value, inclusive, in ascending order. (You SHOULD NOT assume that the start value entered by the user is less than or equal the end value).

Algorithm
Solution
Output