Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Find number of days in the month - clone Given an integer N as an input, where N indicates the number of the month in

Find number of days in the month - clone

Given an integer N as an input, where N indicates the number of the month in a Gregorian year. e.g.1represents "January",2represents "February" and vice versa.

Month numbers 1, 3, 5, 7, 8, 10 and 12 represent Jan, Mar, May, Jul, Aug, Oct, and Dec. These months have 31 days, so display31for them.

Month numbers 4, 6, 9 and 11 represent Apr, Jun, Sep, and Nov. These months have 30 days, so display30for them.

Month number 2 represents Feb, which has 27 or 28 days, so regardless of the leap years display27for Feb.

Input:

1

where:

Input is a month number.

Output:

31

Explanation:As 1 represents the month of January and it has 31 days, so the output is "31".

Assumption:

Month number can be in the range 1 to 12.

Write a python program about this question

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

More Books

Students also viewed these Programming questions