Question: Java Programming Find a 5-digit number ABCDE such that if we place an extra numeral 1 at the beginning, we get a number three times
Java Programming
Find a 5-digit number ABCDE such that if we place an extra numeral 1 at the beginning, we get a number three times smaller than if we put that numeral 1 at the end of the number.
1.b) Write a pseudocode algorithm to test all possible combinations of values for A, B, C, D, and E to find a 5-digit value that makes the puzzle true. In your algorithm use the variable names given below and follow all the requirements listed:
integer variables A, B, C, D, and E for the five digits of ABCDE
int oneBefore to hold the value of ABCDE with an extra numeral 1 at the beginning
int oneAfter to hold the value of ABCDE with numeral 1 at the end of the number
Requirement: For this question your code MUST iterate over all the possible values for each digit using a different loop for each digit.
Requirement: You may NOT declare a single variable to hold or test ABCDE as a single five digit number
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
