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, 22.06.2019 15:30
Whats are the different parts of no verbal comunication, especially body language?
Answers: 3
question
Computers and Technology, 22.06.2019 17:00
The two main ways in which marketers address the competition with their strategies are by satisfying a need better than a competition and by
Answers: 2
question
Computers and Technology, 22.06.2019 21:00
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
question
Computers and Technology, 22.06.2019 22:50
Which is the best minecraft server? a. mineplex b. worldonecraft c. 9b9t d. 2b2t
Answers: 2
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, 05.05.2020 19:08
question
Mathematics, 05.05.2020 19:08
Questions on the website: 13722363