Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design an algorithm and then write a program that prompts the user to enter a month in number and a year, and displays the number

image text in transcribed

Design an algorithm and then write a program that prompts the user to enter a month in number and a year, and displays the number of days in that month on the console. If the month is 2, your program should check if it is a leap year. In a leap year there are 29 days in February. Assume that the user will enter all the input correctly. For example, if the user entered month 2 and year 2020 , the program should display that February 2020 has 29 days. If the user entered month 3 and year 2020 , the program should display that March 2020 has 31 days. Use switch statement to check the month number. To check whether it is a leap year should be done under the case of month 2 only. CS.VS.928|

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

Students also viewed these Databases questions

Question

How was their resistance overcome?

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago