View the step-by-step solution to:

Question

This is the example of execution that I need to create.1)Enter the number to be used:

25

Enter the interval between numbers to add: 8

The sum of the numbers from 1 to 25 at interval, 8, is 48.

2)

Enter the number to be used: 500

Enter the interval between numbers to add: 100

The sum of the numbers from 1 to 500 at interval, 100, is 1500.

And this is the code that I got it so far.

import java.util.Scanner;

public class Repetition {

public static void main(String[] args) {

Scanner keyboard = new Scanner(System.in);

int maximum;

int interval;

String sum;

int count = 1;

System.out.print("Enter the maximum numbrer to be used: ");

maximum = keyboard.next();

System.out.print("Enter the interval between numbers to add: ");

interval = keyboard.next();

for (int i = 0; i <= maximum; ) {

count++;

}

System.out.print("The sum of the numbers from " + @@ + "to " + @@ +

"at interval, " + interval + "is " + sum + ".");

}

}

But I got stuck from this.

View the full answer OpenJDK Runtime Environment (build 10.0.2+13-U
buntu-lubuntu0 . 18 . 04.4)
+ javac -classpath . :/run_dir/junit-4.12. jar -
d . Main. java
+ java -classpath . : /run dir/junit-4.12. jar Ma
in
Enter...

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
• -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents