Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The standard is that you will use opening documentation and document your code adequately. Follow the algorithm to code the class DatetoDayConverter Document your code
The standard is that you will use opening documentation and document your code adequately. Follow the algorithm to code the class DatetoDayConverter Document your code with opening documentation and documentation for each step of the algorithm Write a program to determine the day of the week a person was born given his or her birth date (keyboard input in the form of month 5, day 15, year 1998 for May 15, 1998). The following steps should be used to find the day for the week corresponding to any date. a1. If the year you are checking is less than 1800, store 4 in the variable century. If the year you are checking greater than or equal 1800 and less than 1900, store 2 in the century. If the year you are checking is greater than or equal 1900 and less than 2000, store 0 in the century. Otherwise, store 6 in the century. (required to use - if else if) a2. Store the year as the last 2 digits. Ex 1998 as 98. b. Divide the last two digits of the birth year by 4. Put the quotient (disregarding the remainder) in a variable called total. For example if the person was born in 1983, divide 83 by 4 and store 20 in total. c. Add the birth year (2 digits only) to the total. d. Add the birth date (1st through 31st) to the total. e1. Use the following table to find the month number and add it to total. (required to use - if else if) April and July add 0 January and October add 1 May add 2 August add 3 February, March, & November add 4 June add 5 September and December add 6 e2. Add century to total f. If the year is a leap year and if the month you are working with is either January or February, then subtract 1 from the total. (hint: 2000 will be a leap year divisible by 4) g. Find the remainder when the total is divided by 7. Look up the remainder in the following table to determine the day of the week the person was born. (required to use - switch case) 1 Sunday 5 Thursday 2 Monday 6 Friday 3 Tuesday 0 Saturday 4 Wednesday Output the your name, birth date and day of the week. The output should verify that the date entered is the actual day of the week. Submit your DatetoDayConverter_Lastname.java program using this link.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started