Question: -Can you please solve this program in c++??? Problem Statement: Determine the number of days in a month (use numbers to represent the months) a.

-Can you please solve this program in c++???

Problem Statement:

Determine the number of days in a month (use numbers to represent the months)

a. 31 days: January, March, May, July, August, October, December

b. 30 days: April, June, September, November

c. 28 or 29 days: February. Prompt for the year and using modulus to determine if it is 28 or 29 days

Input Data

Month (use number for the month, 1 for January, 2 for February, etc.)

Output Data

Days in that month

requirements:

1. Prompt for month (use a number)

2. Determine days in that month using switch statements

3. Output number of days in the month, if the user enters 2 for February, then ask the user to input year, if it is a leap year (can be divisible by 4, but cannot be divisible by 100; if it is divisible by 100, it must also be divisible by 400 to be a leap year), then 29 days; otherwise, 28 days (use if statements here). If the users input is not 1-12, output Invalid month entered!

--------------------sample output----------------------

Enter a month (enter 1 for Jan, 2 for Feb, etc.): 3

Days in March: 31

Enter a month (enter 1 for Jan, 2 for Feb, etc.): 2

Enter a year: 2008 Days in February 2008: 29

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!