Question: WRITE IN FORTRAN PLZ 13-1 2. Given a date, it is possible to determine the day of the week for that date using the following
WRITE IN FORTRAN PLZ

13-1 2. Given a date, it is possible to determine the day of the week for that date using the following algorithm (use integer division throughout): . Let y be the 4-digit year, m be a 2-digit value corresponding to the month (for example, for March m = 3, and for November m= 11), and d be the 2-digit day. If m is equal to 1 or 2 then reduce y by 1. Set p= last two digits of y. Set q = first two digits of y. Set r=((m+9) mod 12)+1. Set 8 = 1 Set 1 Set u=4 Set v = d+p+8+2+u+ 5. Set w=v mod 7. The day of the week is given by the value of w, where w=0 would be Sunday. Write a Fortran program to implement this algorithm, asking the user for the year, month and day (each in the form of a numerical value). Your code should include the following functions: FUNCTION day_name (a) that returns the name of the day for a given value of d. FUNCTION month_name (m) that returns the name of the month for a given value of m. Sample output: February 13, 2012 is a Monday. 13-1 2. Given a date, it is possible to determine the day of the week for that date using the following algorithm (use integer division throughout): . Let y be the 4-digit year, m be a 2-digit value corresponding to the month (for example, for March m = 3, and for November m= 11), and d be the 2-digit day. If m is equal to 1 or 2 then reduce y by 1. Set p= last two digits of y. Set q = first two digits of y. Set r=((m+9) mod 12)+1. Set 8 = 1 Set 1 Set u=4 Set v = d+p+8+2+u+ 5. Set w=v mod 7. The day of the week is given by the value of w, where w=0 would be Sunday. Write a Fortran program to implement this algorithm, asking the user for the year, month and day (each in the form of a numerical value). Your code should include the following functions: FUNCTION day_name (a) that returns the name of the day for a given value of d. FUNCTION month_name (m) that returns the name of the month for a given value of m. Sample output: February 13, 2012 is a Monday
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
