Create a new project called04.07Calling Methods in the Mod04Assignments folder. Create a class called MathTrick in the
Fantastic news! We've Found the answer you've been seeking!
Question:
- Create a new project called04.07Calling Methods in the Mod04Assignments folder.
- Create a class called MathTrick in the newly created project folder.
- Complete the static methods in the starter code.
- Utilize Math.random() and any other methods from the Math class as needed.
- Utilize .substring() where appropriate.
- Each method should return a value of the correct data type.
- Call the completed static methods in the main method to complete a program that does the following:
- Generate a random 3-digit number so that the first and third digits differ by more than one.
- Now reverse the digits to form a second number.
- Subtract the smaller number from the larger one.
- Now reverse the digits in the answer you got in step c and add it to that number (String methods must be used to solve).
- Multiply by one million.
- Subtract 733,361,573.
- Then, replace each of the digits in your answer, with the letter it corresponds to using the following table:
- Now reverse the letters in the string to read your message backward.
- Open theMathTrick.javafile to begin your program.
Notice that these instructions double as pseudocode and including pseudocode in a program provides documentation.
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Posted Date: