Question: Write a program named days of month.cpp that prompts to users to enter the year and first three letters of a month ( these letters
Write a program named
days
of
month.cpp
that prompts to users to enter the
year
and first
three letters of a
month
these letters can be either uppercase or lowercase Displays the
number of days of the
month
Your program must displays message
"Invalid month. Please use three first letters
of the month name!"
if the user entered incorrect months name.
Hints:
Use function
std::toupper
or
std::tolower
to standardize the months name
before checking its meaning. These two functions are declared in
string
library.
The February of a leap year divisible by has days instead of days.
Here are some example outputs when running the program from a terminal.
workspacecschw
$
go outdaysofmonth.out srcdaysofmonth.cpp
$
outdaysofmonth.out
Enter a year:
Enter a month: Feb
Feb has days
$
outdaysofmonth.out
Enter a year:
Enter a month: Feb
Feb has days
$
outdaysofmonth.out
Enter a year:
Enter a month:
Invalid month. Please use three first letters o
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
