Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

April S M T W T F S Write a C++ program that will prompt the user to enter a year and produce a calendar

image text in transcribed

April S M T W T F S Write a C++ program that will prompt the user to enter a year and produce a calendar for that year. Do not forget that years that are divisible by 4 but not divisible by 100 unless they are divisible by 400 are leap years. 7 14 21 28 vo 1:22 2. 9 16 23 30 3 10 17 24 8 15 22 29 4 11 18 25 5 12 19 26 The first day of the year can be calculated using the following formula: AR 6 13 20 27 W = (29 - 2*C + y + y/4 + C/4)%7 + 7) % 7 May S M T T W T F S . 1 where Y is the year C = (Y-1) / 100, the century y = (Y-1) % 100 / denotes the integer division % denotes the integer remainder (mod) W is the week day (0=Sunday, ..., 6=Saturday) 5 12 19 26 3 10 17 6 13 20 27 7 14 21 28 8 15 22 29 o 2 9 16 23 30 4 11 18 25 NP . 2 31 . . An example is given below: December Enter year: 2019 S M T T W T (14 F S 2019 1 8 15 22 29 January 2 9 16 23 30 3 10 17 24 31 0 6 8 + 4 11 18 25 5 12 19 26 6 13 20 27 Jowo 7 14 21 28 S M W T F S 6 13 20 27 Nowo 7. 14 21 28 No7 2 9 16 23 30 8 15 22 29 10 3 10 17 24 31 ON NPP 4 11 18 25 5 12 19 26 Note that Sundays should be displayed in red color. For displaying different colors in your output you can use the header file "colors.h that you can find on your intranet. Feel free to practice with different colors for this assignment. February

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

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

What is the formula to calculate the mth Fibonacci number?

Answered: 1 week ago

Question

What is the relationship between humans?

Answered: 1 week ago

Question

What is the orientation toward time?

Answered: 1 week ago