Question: When submitting this lab, submit a .java file called RangeValidated, and create the following structure in Eclipse: Package Name: week6 Class Name: RangeValidated This program

When submitting this lab, submit a .java file called RangeValidated, and create the following structure in Eclipse:

  • Package Name: week6
  • Class Name: RangeValidated

This program is really quite simple. The program will do the following:

  • Ask the user to enter three numbers
  • Use input validation to ensure that all three numbers are integers
  • Multiply each number between the first and second numbers (inclusive of both) by the third number using a for loop
  • Print out the results of each multiplication (see example)
  • Ask the user if they would like to run the program again

Big Hint: The structure of this program is quite similar to the "Whole Numbers Divisible by X" lab.

Example Run

This program will ask the user for three numbers: * A starting number * An ending number * A multiplier The program will multiply each number between the starting number and ending number by the multiplier.

Please enter the starting number: three Invalid Response! Please enter a whole number.

Please enter the starting number: 3 Please enter the ending number: 9 Please enter the multiplier: 2

Multiplying 3 by 2 results in: 6 Multiplying 4 by 2 results in: 8 Multiplying 5 by 2 results in: 10 Multiplying 6 by 2 results in: 12 Multiplying 7 by 2 results in: 14 Multiplying 8 by 2 results in: 16 Multiplying 9 by 2 results in: 18 Would you like to play again? (Y/N): n

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 Databases Questions!