Question
Write a code and draw a flowchart. Task: Write a simple program based on the use of IF statements to show the number of days
Write a code and draw a flowchart.
Task:
Write a simple program based on the use of IF statements to show the number of days in each month. You need to ask the user to enter the number of the month (i.e 1,2,3,4,.12) and based on that you need to output the result as following:
The number of days for month (number of the month) is 30.
Or
The number of days for month (number of the month) is 31.
Or
The number of days for month (number of the month) is 28.
Or
In case the user entered a number other than 1 12 print: Not a valid number
Remember:
Jan, March, May, July, August, October and December have 31 Days
April, June, September and November have 30 days
February has 28 Days.
Bonus:
The output should be as following:
The number of days for (name of the month) is 30.
Or
The number of days for (name of the month) is 31.
Or
The number of days for (name of the month) is 28.
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