Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write program in C++ Write a program that will read in a date(in the form of three integers values: month, day, year) and tell the

write program in C++image text in transcribed

Write a program that will read in a date(in the form of three integers values: month, day, year) and tell the user which day of the year that date is. For example, 1/1/2019 is day #1 of the year. 12/31/2019 is day #365 of the year. And 12/31/2020 is day #366 of the year, because it is a leap year. A year is a leap year, if that number is evenly divisible by 4. Except that any year evenly divisible by 100 is ONLY a leap year if it is also evenly divisible by 400. . . Your program should include the following: Prompt the user and read in three ints: month, day and year(all four digits of the year). Your program should have a user-defined function called determineLeapYear that will return an int to main. determineLeapYear will have one input from main as a parameter: the year entered by the user. The function should determine if the year entered by the user is a leap year or not. If it is a leap year, then the function should return a 1. If it is not a leap year, the function should return a 0. In main, the program should determine what day of the year the user entered date is. Your output should look like the following: 3/2/2020 is day 52 of the year. Or 5/1/2019 is day 120 of the year. Some things you need to know: Months with 31 days: January, March, May, July, August, October, December Months with 30 days: April, June, September, November February has 28 days on non-leap years. February has 29 days on leap years. Run your program two times, using the following data: A. 10 / 30 / 2020 B. 10/3/2019

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

Recommended Textbook for

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

3. Did you seek anyones advice?

Answered: 1 week ago