Answered step by step
Verified Expert Solution
Question
1 Approved Answer
What is the program solution in Visual Studio Code for C++ that will help me get the result that is required in this program assignment?
What is the program solution in Visual Studio Code for C++ that will help me get the result that is required in this program assignment?
* Note that the command has to be ./dayofweek 8 2 1953
The command cannot be numbers on different lines.
Day Of Week Write a program to compute the day of the week on which a specific date falls. Use the following formulas, for the Gregorian calendar: 14-m yo =y- 12 x=yo + + Yo 400 100 m -2 12 mo=m+12 do = [0+x+ 31mo mod 7 12 For example, on what day of the week was August 2, 1953? y = 1953 - 0 = 1953 x = 1953 + 488 - 19 + 4 = 2426 m = 8 + 12x0 - 2 = 6 d = (2 + 2426 + 15) mod 7 = 2443 mod 7 = 0 (Sunday) Your program must have a function with the following signature: int dayofweek(int month, int day, int year). Your program must accept three integer command-line arguments: month, day, and year. Months are numbered as usual; that is, January is 1. Running your program should look like the following: $ ./dayofweek 2 1953 8/2/1953 falls on Sunday. Remember that I means to perform integer division, just like C++ normally does. Submit Source: Choose File No fue chosen Submit View problem in a new window
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