Question: Question 4 . Given a positive integer N , find the lowest multiple of N made up of only 9 ' s and 0 '

Question 4. Given a positive integer N, find the lowest multiple of N made up of only 9's and
0's!
Program Inputs
Enter a positive whole number N:
The user will always follow instructions, no error checking needed!
Program Outputs ?()
Lowest multiple with only 9 s and 0s: XXX.
Replace XXX with the lowest multiple found.
Solution Process ?()
Ask the user for N
Repeatedly create a multiple of N and test if all digits are 9 or 0 :
Create the next multiple of N, called M
Repeatedly divide M by 10 to check each digit:
Check the remainder when dividing M by 10
If the remainder is 9 or 0, reduce M by a factor of 10(ignore any decimals)
If the remainder was another number, try the next multiple of N
Test Case 1:
Enter a positive whole number N: 5
Lowest multiple with only 9s and 0s: 90
Test Case 2:
Enter a positive whole number N: 6
Lowest multiple with only 9 s and 0s: 90
Question 4 . Given a positive integer N , find

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!