Question: Create Java program that will ask the user for a starting number, an ending number, and an increment number. The program will then count upward,

Create Java program that will ask the user for a starting number, an ending number, and an increment number. The program will then count upward, from the starting number up to and including the ending number, by the increment number, displaying each number on a separate line. Also, for each displayed number, the program will say whether the number is even or odd. This program will require the use of a loop as well as the "if/else" statement. Examine the sample outputs carefully in order to structure your code in a logical manner.

Your program must include the below methods:

getStartNum( ) //returns an int

getEndNum( ) //returns an int

getIncrNum( ) //returns an int

calculateOddEven( ) //returns a string and excepts 3 parameters from getStartNum(), getEndNum() and getIncrNum() ***There should be no print statements in this method.

Issue your method calls from main and print the results in main.

Here is a sample run of the program: Please enter a starting number: 3

Please enter an ending number: 19

Please enter an increment number: 3

The number 3 is odd

The number 6 is even

The number 9 is odd

The number 12 is even

The number 15 is odd

The number 18 is even

Thanks for playing!

Here is another sample run: Please enter a starting number: 5

Please enter an ending number: 30

Please enter an increment number: 4

The number 5 is odd

The number 9 is odd

The number 13 is odd

The number 17 is odd

The number 21 is odd

The number 25 is odd

The number 29 is odd

Thanks for playing!

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!