Computers and Technology

challenge program: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.Hint: since replaceLtr is expecting a String, you should use String.valueOf(number) to create a String variable from the integer variable before step g.Then, replace each of the digits in your answer, with the letter it corresponds to using the following table:0 --> Y1 --> M2 --> P3 --> L4 --> R5 --> O6 --> F7 --> A8 --> I9 --> BNow reverse the letters in the string to read your message backward.Open the StarterCode407.java(shown below) file to begin your program.Notice that these instructions double as pseudocode and including pseudocode in a program provides documentation./** * This Math trick and many more can be found at: http://www.pleacher.com/handley/puzzles/mtricks.html * */public class MathTrick {// Step 1) Creates a random 3-digit number where the first and third digits differ by more than one// Hint: use modulus for the last digit and divide by 100 for the first digit.public static int getRandomNum() {int num = 0;int firstDigit = 0;int lastDigit = 0;// complete the methodreturn num;}// Step 2 & 4) reverse the digits of a numberpublic static int reverseDigits (int num) {// complete the method}// Step 7) replace characters in a string according to the chartpublic static String replaceLtr(String str){// complete the method}// Step 8) reverse the letters in a stringpublic static String reverseString(String str) {// complete the method}public static void main(String[] args) {//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 3 and add it to that number.//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 table in the instructions.//8.Now reverse the letters in the string to read your message backward.} // end main} // end class
Bergamot Urgent Care ClinicFORMATTING WORKBOOK TEXT AND DATAGETTING STARTEDOpen the file NP_EX19_2a_FirstLastName_1.xlsx, available for downloadSave the file as NP_EX19_2a_FirstLastName_2.xlsx by changing the "1" to a "2".If you do not see the .xlsx file extension in the Save As dialog box, do not type it. The program will add the file extension for you automatically.With the file NP_EX19_2a_FirstLastName_2.xlsx still open, ensure that your first and last name is displayed in cell B6 of the Documentation sheet.If cell B6 does not display your name, delete the file and download a new copy from the SAM website.PROJECT STEPSJennifer Williams is the business manager at the Bergamot Urgent Care Clinic. Jennifer is adding formatting to the workbook she uses to track statistics on patient visits to make it easier to read and use. Change the theme of the workbook to Office.Switch to the Visits worksheet and then format the headings. Merge and Center the range A1:H1.Apply the Heading 1 style to the range A1:H1.Merge and Center the range A2:H2.Next, Jennifer needs to format the report dates. Change the background color of the range A4:B5 to Gray, Accent 3, Lighter 80% (7th column, 2nd row of the Theme Colors palette).Format the range A4:A5 as bold.Format the range B4:B5 to use a date format with a two-digit month, a two-digit day, and a two-digit year (e.g., 09/26/21).She also wants to format the table headings. Format the range A7:H8 as italic.Apply horizontal centering to the contents of each cell in the range A7:H8.Change the background color of the range A7:H7 to Orange, Accent 2, Lighter 60% (6th column, 3rd row of the Theme Colors palette).Change the background color of the ranges B8:D8 and F8:H8 to Orange, Accent 2, Lighter 40% (6th column, 4th row of the Theme Colors palette).Merge and Center the range A7:A8 and then center the contents of the merged cell vertically.Merge and Center the range E7:E8 and then center the contents of the merged cell vertically.Merge and Center the range B7:D7 and then Merge and Center the range F7:H7.Jennifer would like to spruce up the table data. Change the background color of the range A10:H10 to White, Background 1, Darker 5% (1st column, 2nd row of the Theme Colors palette) and then repeat for the range A12:H12.In the range F9:H12, apply the Percentage number format with zero decimal places.Use the Highlight Cells Rules conditional formatting to format cells in the range G9:G12 with a value less than 6% using Light Red Fill with Dark Red Text.For the merged range A17:A23, rotate the cell contents to 0 degrees and then change the indent to 2.Find and replace all instances of the text "Ins" with Insurance, not including any punctuation. (Hint: You should find and replace two instances.)Finally, she needs to format the workbook for printing. Insert a page break to start a new page at row 14.Set the margins to Narrow.Set rows 1 and 2 as print titles.Create a custom footer for the worksheet. In the left footer section, display the current page number using a Header and Footer element. In the center footer section, display the Sheet Name using a Header and Footer element.Save your changes, close the workbook, and then exit Excel.