Problem: Given as input the year and occurrence number determine when that week begins and ends. Display the week which will begin on the same day of the week as January 1“ of the specified year. There is no input validation required for this assignment. The input given will represent a “Start of week" date that occurs in the year specified. • On page 300 of your C programming text there are several useful formulas given as part of problem 60. All input will be integer data and your program will only be tested with years from 1800 to 2100. • Notice that the name of the month is roughly centered above the 'e' in Wed. Example Execution #1: Enter year number -> 2021 Enter occurrence number -> 1 Start of week: Friday January 1, 2021 End of week: Thursday January 7, 2021 January -=-=- Sun Mon Tue Wed Thu Fri Sat 1 2 3 4 5 6 7 Example Execution #2 (it is possible for a week to begin in one month and end in the next month): Enter year number -> 2020 Enter occurrence number -> 9 Start of week: Wednesday February 26, 2020 End of week: Tuesday March 3, 2020 February -=-=-=-=-=-=-=-=-=-=-=- Sun Mon Tue Wed Thu Fri Sat 26 27 28 29 1 2 3 Example Execution #3 (it is possible for a week to begin in one year and end in the next year): Enter year number -> 2021 Enter occurrence number -> 53 Start of week: Friday December 31, 2021 End of week: Thursday January 6, 2022 December =-=-=- Sun Mon Tue Wed Thu Fri Sat 31 1 2 3 4 5 6

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

Answer with c program and use switch function

Problem: Given as input the year and occurrence number determine when that week begins and ends. Display the week
which will begin on the same day of the week as January 1ª of the specified year. There is no input validation required for
this assignment. The input given will represent a “Start of week" date that occurs in the year specified.
On page 300 of your C programming text there are several useful formulas given as part of problem 60. All input
will be integer data and your program will only be tested with years from 1800 to 2100.
Notice that the name of the month is roughly centered above the 'e' in Wed.
Example Execution #1:
Enter year number -> 2021
Enter occurrence number -> 1
Start of week: Friday January 1, 2021
End of week: Thursday January 7, 2021
January
-=-=---=-=-=-=-=-=-:
---=-
Sun Mon Tue Wed Thu Fri Sat
2
3 4 5 6 7
Example Execution #2 (it is possible for a week to begin in one month and end in the next month):
Enter year number -> 2020
Enter occurrence number -> 9
Start of week: Wednesday February 26, 2020
End of week: Tuesday March 3, 2020
February
-=-----=-=-=-=-
---=-
Sun Mon Tue Wed Thu Fri Sat
26 27 28 29
1 2 3
Example Execution #3 (it is possible for a week to begin in one year and end in the next year):
Enter year number -> 2021
Enter occurrence number -> 53
Start of week: Friday December 31, 2021
End of week: Thursday January 6, 2022
December
-=-=-=-=-=-=-=-=-=-=
=-=-=-
Sun Mon Tue Wed Thu Fri Sat
31
3
4
Transcribed Image Text:Problem: Given as input the year and occurrence number determine when that week begins and ends. Display the week which will begin on the same day of the week as January 1ª of the specified year. There is no input validation required for this assignment. The input given will represent a “Start of week" date that occurs in the year specified. On page 300 of your C programming text there are several useful formulas given as part of problem 60. All input will be integer data and your program will only be tested with years from 1800 to 2100. Notice that the name of the month is roughly centered above the 'e' in Wed. Example Execution #1: Enter year number -> 2021 Enter occurrence number -> 1 Start of week: Friday January 1, 2021 End of week: Thursday January 7, 2021 January -=-=---=-=-=-=-=-=-: ---=- Sun Mon Tue Wed Thu Fri Sat 2 3 4 5 6 7 Example Execution #2 (it is possible for a week to begin in one month and end in the next month): Enter year number -> 2020 Enter occurrence number -> 9 Start of week: Wednesday February 26, 2020 End of week: Tuesday March 3, 2020 February -=-----=-=-=-=- ---=- Sun Mon Tue Wed Thu Fri Sat 26 27 28 29 1 2 3 Example Execution #3 (it is possible for a week to begin in one year and end in the next year): Enter year number -> 2021 Enter occurrence number -> 53 Start of week: Friday December 31, 2021 End of week: Thursday January 6, 2022 December -=-=-=-=-=-=-=-=-=-= =-=-=- Sun Mon Tue Wed Thu Fri Sat 31 3 4
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Fundamentals of Boolean Algebra and Digital Logics
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