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

  1. Create a new project called04.07Calling Methods in the Mod04Assignments folder.
  2. Create a class called MathTrick in the newly created project folder.
  3. Complete the static methods in the starter code.
    1. Utilize Math.random() and any other methods from the Math class as needed.
    2. Utilize .substring() where appropriate.
    3. Each method should return a value of the correct data type.
  4. Call the completed static methods in the main method to complete a program that does the following:
    1. Generate a random 3-digit number so that the first and third digits differ by more than one.
    2. Now reverse the digits to form a second number.
    3. Subtract the smaller number from the larger one.
    4. 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).
    5. Multiply by one million.
    6. Subtract 733,361,573.
    7. Then, replace each of the digits in your answer, with the letter it corresponds to using the following table:
    8. Now reverse the letters in the string to read your message backward.
  5. Open theMathTrick.javafile to begin your program.

Notice that these instructions double as pseudocode and including pseudocode in a program provides documentation.

Step by Step Solution

3.53 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres an example solution for the MathTrick class that follows the provi... View full answer

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!