Question
Concepts Review of CS1110 Concepts such as basic data structures, control flow structure and function in Python Use flow chart to design a function Problem
Concepts Review of CS1110 Concepts such as basic data structures, control flow structure and function in Python Use flow chart to design a function Problem Specification Develop an application in Python to determine the day of the week a person was born given his or her birthday, using the details specified below. You are to write a Python program that ask the user to input any birthdate using the formula mm/dd/yyyy then split it into a month, day, and year. Using a reference date such as 01/01/1920 (this reference date will be assumed in this assignment), which is a Thursday, you can count the number of days from the reference date to the birthdate to determine the weekday of the birthdate. Dont forget some leap years during the calculation. Assume that the users birthdate > references date. Example: Assuming the user input 9/14/1981 then the program should print Monday, meaning the 14th of September of 1981 was a Monday. Design Requirements Basic Structure Your program should have the following functions: 1) The main function (named main). This function should ask the user to input any birthdate then call the getWeekday function to return the weekday of the birthdate then display it on the terminal. 2) A function (named isLeap) that takes a year as a parameter and return either true (the year is a leap year) or false (not a leap year). 3) A function (named daysPerMonth) that takes two parameters: month and year as numbers and return the number of days in that month of that year using isLeap function. CS 1120 (Python) - Spring 2021 LA1 the weekday calculator 4) A function (named daysPerYears) that takes two parameters: year1 and year2 as numbers and return the total number of days in those years using daysPerMonth function. 5) A function (named getWeekday) that returns the weekday of the user birthdate as a string. You should count the number of days between the user and reference dates and since you know the weekday of the references date (for 1/1/1920 is Thursday) then you can tell what the weekday of the users date is. For example, if users birthdate is 1/9/1920 then the number of days between the two dates is 8 and since Thursday comes after every 7 days then the weekday is a Friday (think about it). Now to count the total days you, will encounter three scenarios (possibly, the first and second together): a) Check if there are more than one year between the two dates. For example, birthdates year is 5/5/1984. In this case, you must count days per year in all those years excluding 1920 and 1984 using the daysPerYears function. b) Check if users birthdate is in the next year after the references date. For example, users birthdate is 6/12/1921. You must count the number of days from 1/1/1920 to 1/1/1921 (reference year) plus the number of days from 1/1/1921 to 6/12/1921 (birthdates year) using daysPerMonth function. c) Check if users birthdate and references date are both in the same year. For example, users birthdate is 3/4/1920. Thus, no years are involved in the calculation, only months (and then use daysPerMonth function) and sometimes only days if both dates are in the same month. The output and interface should be neat and well-described. See the example provided in the Testing Phase section. All user input must be done with functions and the functions should clearly specify the range for each integer. A comment should be given for each function describing what the function does in terms of parameters and a return value. Flowchart You have to design a flowchart for each function to illustrate how function is designed. Also, you need to design a flowchart to show how the drive code is designed in terms of how inputs are received and the functions are called. Implementation Phase Using the pseudocode developed, write the Python code for your assignment. This is a two-week assignment. CS 1120 (Python) - Spring 2021 LA1 the weekday calculator Testing Phase Your program should include code to validate user input and ensure that all input meets the specifications. If input is not valid, your program should keep looping to force the user to provide valid input. Each time your program loops, it should provide information to the user to indicate what is considered valid input. Build your program incrementally, carefully testing each function as you go. Example: This program is used to find the weekday of your birthday Please enter your birthdate: 1/2/1920 The weekday of 1/2/1920 is a Friday Additional Requirements Coding Standards You must adhere to all conventions in the CS 1120 Python coding standards (discussed in class and in the Lab). This includes the use of white spaces and indentations for readability, and the use of comments to explain the meaning of various functions and attributes. Be sure to follow the conventions also for naming variables, function parameters, and functions. Assignment Submission Generate a .zip file that contains all your files including: o Program Files o Any input or output files o Flowchart.
GU10 221 JAI Lab Assignment 1 The weekday calculator IR LA CELCSESSA ST: CUKAPID 1 TYTI Problem Specification Dr. Hentet 12 MIX I kath.xin inrrt ww*+-+*+-+--- bwkLIH ATLANTIK&vedr. wie SIX. Uusign Hequirements 11 Haruna Tarikh Il tratta Ves ! L'risidh e rru Teringir CUP are Awbdelaar 416 phil. La THASHX: XXSHIN Kle, bedah whether trailer 1. WWW.HA! Tools 3.1 TM Virt 14: wwwww.xsnt Streldes intus Perhentian bred vive+ plenebb vilket Fourhan auch utworX SX Wid che le Implementation Phase ur; CH C C D x R YETU IN 112, 4 AVI Teen Phase EXOTXXX thr: hrdwergelt .ANHEN . - .. Laitilauircuns K. Hitove XXIX. Rainer Sumbaion CHHM1xch: at HINTAY GU10 221 JAI Lab Assignment 1 The weekday calculator IR LA CELCSESSA ST: CUKAPID 1 TYTI Problem Specification Dr. Hentet 12 MIX I kath.xin inrrt ww*+-+*+-+--- bwkLIH ATLANTIK&vedr. wie SIX. Uusign Hequirements 11 Haruna Tarikh Il tratta Ves ! L'risidh e rru Teringir CUP are Awbdelaar 416 phil. La THASHX: XXSHIN Kle, bedah whether trailer 1. WWW.HA! Tools 3.1 TM Virt 14: wwwww.xsnt Streldes intus Perhentian bred vive+ plenebb vilket Fourhan auch utworX SX Wid che le Implementation Phase ur; CH C C D x R YETU IN 112, 4 AVI Teen Phase EXOTXXX thr: hrdwergelt .ANHEN . - .. Laitilauircuns K. Hitove XXIX. Rainer Sumbaion CHHM1xch: at HINTAYStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started