1Write a for loop that repeats seven times, asking the user to enter a number. The loop should also calculate the sum of the numbers entered and display the final sum.       2Write a for loop that displays the following set of numbers:       0, 10, 20, 30, 40, 50 . . . 1000 What’s the initialization step? The Boolean test/condition? Update action/incrementation?     3Convert the while loop in the following code segment to a for loop: int count = 0; while (count < 50) { System.out.println("count is " + count); count++; }     4Convert the following for loop to a while loop:        for (int x = 50; x > 0; x--) {                   System.out.println(x + " seconds to go.");        }   5Write the complete Java program for problem #1 above. Name the class SumSeven. please solve 4 and 5

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 12RQ
icon
Related questions
Question
  • 1Write a for loop that repeats seven times, asking the user to enter a number. The loop should also calculate the sum of the numbers entered and display the final sum.

 

 

 

  • 2Write a for loop that displays the following set of numbers:

      0, 10, 20, 30, 40, 50 . . . 1000

What’s the initialization step?

The Boolean test/condition?

Update action/incrementation?

 

 

  • 3Convert the while loop in the following code segment to a for loop:

int count = 0;

while (count < 50) {

System.out.println("count is " + count);

count++;

}

 

 

  • 4Convert the following for loop to a while loop:

       for (int x = 50; x > 0; x--) {

                  System.out.println(x + " seconds to go.");

       }

 

  • 5Write the complete Java program for problem #1 above. Name the class SumSeven.
  • please solve 4 and 5
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of Loop
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,