Question: 1. Create a utility class file named MyUtils.java with the appropriate header for the course. This utility class can be used to hold many different

1. Create a utility class file named MyUtils.java with the appropriate header for the course. This utility class can be used to hold many different utilities methods you may want to use in the future. The following UML Class Diagram will specify the minimum required structure for this activity: MyUtils +getFullDate(dateIn:String):String

2. Write a static utility method named getFullDate that takes a String argument as its parameter and returns a fully description version of the date passed into the method. The method must:

a. Split the parameter String into its component parts using substring, indexOf, and possibly other String methods to obtain the numeric forms of the month, day of the month, and year. The String date passed should be in the format month/day/year where the year is a four-digit year. Store each item in their own String variables.

b. Convert each of the String variables created in step a into integer variables, using Integer.parseInt(), to be used in Zellers Congruence.

c. Using the appropriate nested if-else structure where necessary for months 1 and 2, determine the day of the week for the date entered using Zellers Congruence. Be sure to assign the day of the week to its own integer variable.

d. Using a switch structure, turn the month number into a String variable that gives the month name in English. (1 will assign the String variable to January, etc.)

e. Using a second switch structure, turn the day of the week integer determined in step c into the day of the week in English. (0 will assign the String variable to Saturday, etc.)

f. Return the fully descriptive date as the result of the method.

3. Write a Java program in a class named LastnameFirstnameDayOfWeek with a main method, where Lastname is your actual last name and FirstName is your actual first name. Your program must:

a. Include a complete Java header as shown in the Blackboard Resources.

b. Set up a Scanner named key for keyboard input.

c. Prompt the user to input a date in the format mm/dd/yyyy and read that input into a String named dateIn using nextLine(). d. Pass the date that was input into your MyUtils. getFullDate method and print out the fully formatted date. For example: i. If the user entered 2/15/2023 then the program would print what the utility method returned: Wednesday, February 15, 2023

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 Databases Questions!