subject

The goal of this program is to have a program print out a perfectly formatted 12-month calendar based on two input values.
The program must follow these requirements:
• Must have only two inputs:
o First the program will ask for an integer for the year of the calendar using the following text:
▪ "Enter a year:"
o Second the program will ask for an integer that represents the day of the week that January 1 will begin
on, (ex. Sunday = 0, Monday = 1, Tuesday = 2, etc.), using the following text:
▪ "Enter the first day of the year, (ex. Sunday = 0, Monday = 1, Tuesday = 2, etc.):"
o The program should continue to ask for the second input if it does not fall between 0 and 6.
• It must include a function with the name "month_details".
o This function will have to have two parameters:
▪ One will be an integer representing what month it is
▪ Second will be an integer representing what year The calendar is.
o This function will return two values in a tuple:
▪ One return value is a string with the name of the month
▪ Second will be an integer representing how many days are in that month
o This function will use the two integer parameters and decide what values to return for the name of the
month and how many days are in that month (30, 31, 28, or 29)
• The program will need to use loops (either "while" or "for" or both)
• The program will need to use several "if" statements. Some maybe just "if", some "if/else", and some "if/elif"
• Each month will be like the bellow example:
January - 2021

Sun Mon Tue Wed Thu Fri Sat
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

February - 2021

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28

Cont. until Dec.

December - 2021

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

• Each month will follow these requirements:
o Month name and year needs to be approximately centered over the month calendar
o Must be a line of hyphens under the month name
o Must print the 3-letter weekday abbreviation
o The number must appear right justified under the appropriate weekday
o Numbers must be perfectly lined up
o Each month must start under the appropriate day of the week
o This means you have to print some spaces each month before you print the number 1
• Everything must line up in nice columns using a width of approximately 4-7 spaces
• You will want to use both regular "print" statements as well as some format "print" statements
o print('Hello World!')
o print('{:15s}'.format('Hello World!'))
• The whole program, including the function, must be done in under 150 lines of code.
o The whole program can actually be done in under 90 lines of code
• You may NOT use any type of array or list

Hints:
• Take your time and build the program a little at a time
o Do iterative programming, create one solution then another and another etc.
o Keep running your code a little bit at a time to see the new results with the new code you just added
o DO NOT try to write the whole program at once
o Best to try and get just the month of January to print out correctly first using "loops" and "if" statements
and "print" statements
• This program will have several loops
• You need to keep track of three major things
o What month
o What day of the week
o What day of the month
• You will call the function each time you begin a new month
• Again, you must work towards the solution a little at a time

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Ihave buncha points. does anyone want any?
Answers: 1
question
Computers and Technology, 22.06.2019 13:30
1. technician a says horsepower information can be used by consumers to compare the power of different automobile engines. technician b says that manufacturers will often list the horsepower output of their engines in the online service information. who is right?
Answers: 2
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 24.06.2019 02:50
Be sure to answer all parts. synthesize the following compound from benzene. a. b. c. d. e. f. reaction [1] conditions: a b c d e f reaction [1] product: draw structure reaction [2] conditions: a b c d e f reaction [2] product: draw structure reaction [3] conditions: a b c d e f reaction [3] product:
Answers: 3
You know the right answer?
The goal of this program is to have a program print out a perfectly formatted 12-month calendar base...
Questions
question
Mathematics, 12.10.2019 09:30
question
Mathematics, 12.10.2019 09:30
Questions on the website: 13722363