Create a complete Java program that shall allow the user to accept three integer values representing the START, END, and STEP respectively. The START should always be lesser than the END value, and the STEP is always greater than zero. The program shall print vertically the values starting from the START to the last value which can be equal to or lesser than the END incremented by the STEP value, and finally the SUM of all the output values. Example: INPUT SCREEN: Input START value = __              (assuming 1 is entered by the user) Input END value = __                  (assuming 10 is entered by the user) Input STEP value = __                 (assuming 2 is entered by the user) OUTPUT SCREEN: 1 3 5 7 9 SUM = 25 Do you want to try again (Y/N) ? __   (assuming Y is entered by the user. The program should repeat again.) Requirements: 1. Your program should automatically detect any errors in the initial input. 2. Your program should have an additional feature that asks the user whether the user wants TO TRY AGAIN. The Program will not terminate until the user inputs any character other than ‘Y’ or ‘y’.  3. Implement the program using any looping constructs discussed previously.  4. Copy and paste your complete source code here then submit it.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

Create a complete Java program that shall allow the user to accept three integer values representing the START, END, and STEP respectively. The START should always be lesser than the END value, and the STEP is always greater than zero. The program shall print vertically the values starting from the START to the last value which can be equal to or lesser than the END incremented by the STEP value, and finally the SUM of all the output values.

Example:

INPUT SCREEN:

Input START value = __              (assuming 1 is entered by the user)
Input END value = __                  (assuming 10 is entered by the user)
Input STEP value = __                 (assuming 2 is entered by the user)

OUTPUT SCREEN:

1
3
5
7
9
SUM = 25

Do you want to try again (Y/N) ? __   (assuming Y is entered by the user. The program should repeat again.)

Requirements:
1. Your program should automatically detect any errors in the initial input.
2. Your program should have an additional feature that asks the user whether the user wants TO TRY AGAIN. The Program will not terminate until the user inputs any character other than ‘Y’ or ‘y’. 
3. Implement the program using any looping constructs discussed previously. 
4. Copy and paste your complete source code here then submit it.

Java Source Code:
Loops.java
import java.util.Scanner;
3 apublic class Loops{
public static void main (String args []){
Scanner input = new Scanner (System.in);
int Start, End, Step, Sum;
int sum = 0;
char option;
8
10
do {
System.out.print("Please enter START value: ");
Start = input.nextInt ();
11
12
13
System.out.print("Please enter END value: ");
End = input.nextInt ();
14
15
16
System.out.print ("Please enter STEP value: ");
Step = input.nextInt ();
System.out.println();
17
18
19
20
21
22
23
25
26
27
20
Activa
Transcribed Image Text:Java Source Code: Loops.java import java.util.Scanner; 3 apublic class Loops{ public static void main (String args []){ Scanner input = new Scanner (System.in); int Start, End, Step, Sum; int sum = 0; char option; 8 10 do { System.out.print("Please enter START value: "); Start = input.nextInt (); 11 12 13 System.out.print("Please enter END value: "); End = input.nextInt (); 14 15 16 System.out.print ("Please enter STEP value: "); Step = input.nextInt (); System.out.println(); 17 18 19 20 21 22 23 25 26 27 20 Activa
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education