ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 09 May 2017 My Price 9.00

The program then calculates the number of days

Write a Python program "daysInMonthXXXXX.py" where XXXXX should be replaced by your ID. The program ask user to enter a accepts 2 inputs: a month and year. The program then calculates the number of days in this month of this year. The algorithm to determine if a year is a leap year or not can be found here: http://www.timeanddate.com/date/leapyear.html A year is leap if it is divisible by 400 (example 1600). A year is leap if it is divisible by 4 but not divisible by 100 (example 2012). A year is Not leap if it is divisible 4 and by 100 (example 1700). A year is Not leap if it is not divisible by 4(example 2013). Your program should display an error message when user enters a 0 or negative number for a year. A month also has to be from 1 through 12. Create a function isLearYear(year) and put code for leap year determination in this function. This function should return either true or false. Create a function daysInMonthYear(month, year) to do the calculation of days in month. This function returns the number of days. Main function should read the input, check the input values, print error message if inputs are not valid. If both inputs are good, then main will call the function daysInMonthYear(month, year). Examples of program run: This program was written by <your name> Please Enter a year: 2001 Please Enter a month: 2 There are 28 days in the month 2 of year 2001 ------------------------------------------- This program was written by <your name> Please Enter a year: 2000 Please Enter a month: 2 There are 29 days in the month 2 of year 2000 ------------------------------------------- This program was written by <your name> Please Enter a year: 1600 Please Enter a month: 2 There are 29 days in the month 2 of year 1600 ------------------------------------------- This program was written by <your name> Please Enter a year: 1700 Please Enter a month: 2 There are 28 days in the month 2 of year 1700 ------------------------------------------- This program was written by <your name> Please Enter a year: 2000 Please Enter a month: 1 There are 31 days in the month 1 of year 2000 ------------------------------------------- This program was written by <your name> Please Enter a year: 2000 Please Enter a month: 3 There are 31 days in the month 3 of year 2000 ------------------------------------------- This program was written by <your name> Please Enter a year: -2 Invalid year -2 ------------------------------------------- This program was written by <your name> Please Enter a year: 2000 Please Enter a month: 13 Invalid month 13

Answers

(11)
Status NEW Posted 09 May 2017 05:05 AM My Price 9.00

-----------

Not Rated(0)