Question
Write a program that accepts an integer limit and an integer value and that prints a complete line of output reporting the multiples of value
Write a program that accepts an integer limit and an integer value and that prints a complete line of output reporting the multiples of value uptil the limit.
Keep prompting the user for a value and display the multiples until the user presses 'n' or 'N' for No.
Notice that the multiples are separated by commas. You must exactly reproduce this format. The integer value entered must be greater than or equal to 1.
Hint: Use a for loop to calculate and display the multiples and a do while loop to repeat the program
Example output:
Welcome to the Multiples Program
Enter a number greater than or equal to 1: 3
How many multiples you would like to see : 5
The first 5 multiples of 3 are 3, 6, 9, 12, 15
Would you like to find multiples of another number ? Enter Y for yes and N for no :Y
Enter a number greater than or equal to 1: 7
How many multiples you would like to see : 3
The first 3 multiples of 7 are 7, 14, 21
Would you like to find multiples of another number ? Enter Y for yes and N for no :Y
Enter a number greater than or equal to 1: 0
Number must be greater or equal to 1 : 2
How many multiples you would like to see : 5
The first 5 multiples of 2 are 2, 4, 6, 8, 10
Would you like to find multiples of another number ? Enter Y for yes and N for no :N
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Below is a Java program that fulfills the requirements you provided It prompt...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started