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
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