Question: Write a C++ program to do the following: a. Create an enum type months to represent the 12 months of the year. Be sure to

Write a C++ program to do the following:

a. Create an enum type months to represent the 12 months of the year. Be sure to start January at 1.

b. Write a bool function named isSummer that takes in a parameter of type months. Have the function return TRUE if it is a Summer month (For this program use June, July and August as Summer months) and FALSE otherwise

c. Write a void function printMonth that takes in a parameter of type months. Have it print to the console the string representation of the month. (you do not need to use the string class, you may just do a cout << January; statement for example)

d. Write a main method that loops through every month and prints both the month name and whether or not it is summer. Use a for loop and use the methods you wrote in parts a, b and c. For loop should use the enum type as the control, not ints. Ex output: January not summer February not summer March not summer April not summer May not summer June summer July summer etc

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!