Question: In Java Write a for loop that sums up all the multiples of 7 from 7 to 7 0 0 and prints up the final

In Java Write a for loop that sums up all the multiples of 7 from 7 to 700 and prints up the final calculated sum (which is 35350). In other words, the for loop adds up 7+14+21+...+686+693+700.
Write a while loop that begins to add up the same sequence of numbers but stops when the sum of the numbers so far is greater than 1000. This loop should also use a variable to count up how many times the loop repeated in order for the sum to rise above 1000. The sum should be just over 1000(specifically 1071) and the count should be 17. Print out both numbers.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!