in C++   Review - for loops, if-else, switch, functions     Many computer applications, such as Microsoft Excel, can compare date values that occur after January 1, 1900.  For example, these programs can determine if 06/06/99 is less than (comes before) 11/01/00.  They use January 1, 1900 as their reference point.  This becomes day 1.  All other dates are calculated as to the number of days they are relative to January 1, 1900.  For example January 2, 1900 is equal to 2.  October 31, 2000 is equal to 36829.    Notwithstanding, Excel cannot tell you which day of the week these two dates fell on.   For this assignment, you are to write a C++ program which will:   Have the User enter in a date.    Calculate the "day value" of that date.  For this you will need to write several functions as stated below.   A function that determines if a year is a leap year. A function that determines the number of days in a month. Remember if the year is a leap year then February has 29 days. You will need the leap year function. This is an example of a function calling another function. A function that determines the number of days in the year of the date in question. This function uses the days in month function. Based on the "day value" of the date, and the fact that January 1, 1900 was Monday, write another function that prints the day of the week that date fell on For 10/31/2000 you need to calculate the number of days from 01/01/1900 to12/31/1999, and then calculate the days from 01/01/2000 to 10/31/2000. This will give you the "day value".  Use a modulus 7 division on this day value to find the day of the week the date falls out on. Your input file will have at least twenty dates to process. You will read up to the end of file.   Your program should print a line of code for each date to the console as follows:   Tuesday 10/31/2000 has a day value of 36829

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

in C++

 

Review - for loops, if-else, switch, functions

 

 

Many computer applications, such as Microsoft Excel, can compare date values that occur after January 1, 1900.  For example, these programs can determine if 06/06/99 is less than (comes before) 11/01/00.  They use January 1, 1900 as their reference point.  This becomes day 1.  All other dates are calculated as to the number of days they are relative to January 1, 1900.  For example January 2, 1900 is equal to 2.  October 31, 2000 is equal to 36829.    Notwithstanding, Excel cannot tell you which day of the week these two dates fell on.

 

For this assignment, you are to write a C++ program which will:

 

  1. Have the User enter in a date. 

 

  1. Calculate the "day value" of that date.  For this you will need to write several functions as stated below.

 

  1. A function that determines if a year is a leap year.
  2. A function that determines the number of days in a month. Remember if the year is a leap year then February has 29 days. You will need the leap year function. This is an example of a function calling another function.
  3. A function that determines the number of days in the year of the date in question. This function uses the days in month function.
  4. Based on the "day value" of the date, and the fact that January 1, 1900 was Monday, write another function that prints the day of the week that date fell on
    • For 10/31/2000 you need to calculate the number of days from 01/01/1900 to12/31/1999, and then calculate the days from 01/01/2000 to 10/31/2000. This will give you the "day value".  Use a modulus 7 division on this day value to find the day of the week the date falls out on.
  5. Your input file will have at least twenty dates to process. You will read up to the end of file.

 

  1. Your program should print a line of code for each date to the console as follows:

 

Tuesday 10/31/2000 has a day value of 36829

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 8 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education