View Single Post
  #1 (permalink)  
Old March 20th, 2005, 07:10 AM
showmaak showmaak is offline
Registered User
 
Join Date: Mar 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default if / else problem...

As I am novice to C++, I would like to get help from the experts writing simple program for the following problem...

Write a C++ program that reads a month number as an integer (form 1 to 12) and a d ay number as an integer (form 1 to 31).
If the month entered is not between 1 and 12 inclusive, print a message informing the user that an invalid month has been entered. If the day entered is not between 1 and 31 inclusive, print a message informing the user that an invalid day has been entered.

If no error messages are displayed, print “Winter” if the month is in the range 1-3, “Spring” if the month is in the range 4-6, “Summer” if the month is in the range 7-9, and “Autumn” otherwise.


Thank you...

Reply With Quote