ovided data.

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

please do this in program in c++ and avoid using any strings/manipulators. and dont forget to firstly ask user to input their 3 intials! Also the output should match the provided data.  Many thanks in advance

Plan and code a C++ program utilizing selection structure. Write an interactive C++ program to determine the day of the
week for any given date from 1900-2099. Following are the steps you should use:
A. Input the date in 3 separate parts, month, day and 4-digit year. Error check to make sure the month is between
1 and 12, the day between 1 and 31, and the year between 1900-2099. If there is an error, identify the type of
error and stop the program.
B. If the data is good, divide the last two digits of the year by 4. Store the quotient (ignoring the remainder) in
Total. For example, for 1983, divide 83 by 4 and store 20 in Total.
C. Add the last 2 digits of the year to Total.
D. Add the two digits of the day of the month to Total.
E. Using the following table, find the "value of the month" and add it to Total.
January = 1 February = 4
April = 0
July = 0
October =1 November = 4
March = 4
May = 2
August = 3
June = 5
September = 6
December = 6
F. If the year is 2000 or later, add 6. If the year is 2000 exactly and the month is January or February, subtract 1.
G. Then, determine if the year is a leap year. A leap year is divisible by 4 but not divisible by 100. If it is a leap year
and the month is January or February, subtract 1.
H. Find the remainder when the Total is divided by 7.
1. Use the remainder to find the day:
0= Saturday
3= Tuesday
6 = Friday
1= Sunday
4= Wednesday 5= Thursday
2= Monday
Input
Your three initials, the month, day, and 4-digit year of the date.
Output
All user prompts. Your 3 initials. All the input fields. The day of the week of the date entered if the data is valid.
Appropriate error message if the data is invalid. Be sure your output file contains user prompts and what was entered by
the user in addition to the results of your program processing.
Run
Run with the following data:
3/13/2014 - Thursday
1/1/1996 - Monday
2/2/2000 - Wednesday
12/20/1981 - Sunday
3/17/1895 - X
4/10/2130 -X
14/8/1933 -X
10/33/1920 - X
Turn In
Turn in source code and program output.
Transcribed Image Text:Plan and code a C++ program utilizing selection structure. Write an interactive C++ program to determine the day of the week for any given date from 1900-2099. Following are the steps you should use: A. Input the date in 3 separate parts, month, day and 4-digit year. Error check to make sure the month is between 1 and 12, the day between 1 and 31, and the year between 1900-2099. If there is an error, identify the type of error and stop the program. B. If the data is good, divide the last two digits of the year by 4. Store the quotient (ignoring the remainder) in Total. For example, for 1983, divide 83 by 4 and store 20 in Total. C. Add the last 2 digits of the year to Total. D. Add the two digits of the day of the month to Total. E. Using the following table, find the "value of the month" and add it to Total. January = 1 February = 4 April = 0 July = 0 October =1 November = 4 March = 4 May = 2 August = 3 June = 5 September = 6 December = 6 F. If the year is 2000 or later, add 6. If the year is 2000 exactly and the month is January or February, subtract 1. G. Then, determine if the year is a leap year. A leap year is divisible by 4 but not divisible by 100. If it is a leap year and the month is January or February, subtract 1. H. Find the remainder when the Total is divided by 7. 1. Use the remainder to find the day: 0= Saturday 3= Tuesday 6 = Friday 1= Sunday 4= Wednesday 5= Thursday 2= Monday Input Your three initials, the month, day, and 4-digit year of the date. Output All user prompts. Your 3 initials. All the input fields. The day of the week of the date entered if the data is valid. Appropriate error message if the data is invalid. Be sure your output file contains user prompts and what was entered by the user in addition to the results of your program processing. Run Run with the following data: 3/13/2014 - Thursday 1/1/1996 - Monday 2/2/2000 - Wednesday 12/20/1981 - Sunday 3/17/1895 - X 4/10/2130 -X 14/8/1933 -X 10/33/1920 - X Turn In Turn in source code and program output.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Database Environment
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
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