Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I know how to start the project but Im struggling with the rest of it Background - Many times one needs to do calculations on

I know how to start the project but Im struggling with the rest of it image text in transcribed
Background - Many times one needs to do calculations on dates. Programs like Excel use the number of days since 1/1/1970 when doing these calculations. calculation, yet, but we can make a start We don't know enough C++ to completely do this Problem-You will prompt a user for a month, a day and a year. You will then tell the user how many days since January 1 of that year the input date is. For example if the user inputs a 3 for the month, a 2 for the day, and 2000 for the year the program outputs the number of days as being 62. Note 2000 is a leap year. Therefore you must test to see if a year is a leap year when doing this problem. The three rules which the Gregorian calendar uses to detemine leap year are as follows: 1. Years divisible by four are leap years, unless.. 2. Years also divisible by 100 are not leap years, except..." 3. Years divisible by 400 are leap years." Combining rules 2 & 3: Centennial years that are not divisible by 400 are not leap years. Another way of looking at the definition of a leap year Leap years fall on any year that either can be evenly divided by 400 or evenly divided by 4 and not evenly divided by 100. Therefore the years 1900, and 2100 are NOT leap years. Method- Use if - else statements to decide: 1. How many days to add given the month 2. Whether to add an additional day for leap year 3. Don't forget to add in the days for the current date within a month Ex. if the user inputs month 4, day 22, year 1995 Since 1995 is not a leap year add 90 days (total for January, February, and March) then to that add 22 for the number of days in April for a total of 112 days. Output-Organize your prompts, and output in a neat orderly fashion. Print a statement telling whether the year is a leap year and another statement about the number of days since January 1 of that year has past Turn In - Your source code and 3 valid examples (pick ones that are/are not leap years) showing that your program works

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What aspects would it be impossible to capture?

Answered: 1 week ago

Question

Enhance your words with effective presentation aids

Answered: 1 week ago