Suggested Logic: • Display a Title • Get the month from the user • Validate the month • Get the day from the user • Validate the day Get the year from the user • Calculate the day of the week o Convert M (month) to the correct value and change year is necessary o Convert the year to C and D o After setting up the values for M, K, C, and D, use Java operators to apply the formula o Get the value of G Display the day of the week using a switch statement: o Gis the day of the week where: • 0= Sunday • 3= Wednesday 6 = Saturday 1= Monday 4 = Thursday Any other value: Display an error message. 2= Tuesday 5 = Friday • Display the number of entries made by the user Testing: Test your final program for these values plus others including your own birth date: Month Day Year Result 1899 Sunday Monday 2014 2000 Wednesday 1 3 10 1 19 Here is a sample output of this project: Zeller's Algorithm Enter month ( or e to exit): 9 Enter day: Enter year: The day is Thursday 2003 Enter month ( or e to exit): 2 Enter day: Enter year: The day is Friday 14 2014 Enter month ( or e to exit): e Number of entries - 2
Need help with revising and completing my code using requirements. NO tutor is using the formst suggested which is very confusing for me. Please try to do it using
Display a Title
• Get the month from the user
• Validate the month
• Get the day from the user
• Validate the day
• Get the year from the user
• Calculate the day of the week
o Convert M (month) to the correct value and change year is necessary
o Convert the year to C and D
o After setting up the values for M, K, C, and D, use Java operators to apply the formula
o Get the value of G • Display the day of the week using a switch statement: o G is the day of the week where:
0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday
Any other value: Display an error message.
• Display the number of entries made by the user
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images