C++
Write a program that illustrates enumeration types. Define an enumeration type for the months of the year. This should be global. Put it above the main program. Declare a variable of the enumerated type called month; Declare an array of unsigned integers called year[12] and initialize the array to the days in each month. (Just assume 28 for February.) 1. Write a loop that will progress from January through December printing out the days in each month. The index that you use should employ the elements of the enumerated type. for (int k = JAN; etc. ) 2. Next print out the days of the months for the warm summer months here in Alabama (May through September). You may use the variable month in a loop or the individual month indices (JUN etc.) 3. Print out the names of the spring months (March - June). Here you will use a loop that starts with March and ends with June. You will have to use a series of if statements or a switch statement to print out the actual month name instead of the integer representing that month. See the example for days of the week from the notes.
Upload you code and screen shot.
Please find the code below:
#include <iostream>
using namespace std;
enum month{Jan, Feb, Mar, Apr, May, Jun, Jul,
Aug, Sep, Oct, Nov, Dec};
int main()
{
int i;
int year[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31,
30, 31};
for (i=Jan; i<=Dec; i++){
cout<<"Days for month
"<<i+1<<" is : "<<year[i]<<endl;
}
cout<<"\n\nDays in summer are :
"<<endl;
for (i=May; i<=Sep; i++){
cout<<"Month
"<<i+1<<" Day : "<<year[i]<<endl;
}
cout<<"\n\nNames of Spring months are :
"<<endl;
for (i=Mar; i<=Jun; i++){
cout<<"Month
"<<i+1<<" Name : ";
switch (i){
case Mar:
cout<<"March"<<endl; break;
case Apr:
cout<<"April"<<endl; break;
case May:
cout<<"May"<<endl; break;
case Jun:
cout<<"June"<<endl; break;
}
}
return 0;
}
output:

C++ Write a program that illustrates enumeration types. Define an enumeration type for the months of...
For c++ Write a complete C++ program and declare 2 arrays type double size 5. The name of the first array is Salary and the name of the second array is Tax. Use a for loop loop and enter 5 salaries type double into array Salary. Then multiply each element of array Salary by .10 (10 percent), and save the result into array Tax. Print/display the content of both arrays. Hint: the content of array Tax is 10% percent of...
write a C++ program that sells candy and drinks using the enumeration type. You must use the following within your program: enum sizes {SMALL, MEDIUM, LARGE, JUMBO}; sizes Candysize, drinkSize; You should create a menu that asks the user to choose what size of drink they want and to choose what size of popcorn they want. Then I have to print out the total cost of the drink and popcorn. The Prices: Candy Soda Small 1.25 1.50 Medium 2.25 2.50...
debug the program in java /** This program demonstrates an array of String objects. It should print out the months and each day of the month. It should print out the month name and days for the month with the least days It should print out the average number of days in each month Here is what it should print when executed: January has 31 days. February has 28 days. March has 31 days. April has 30 days. May has...
C++ Program Int Main First Please Write one program that does the following: 1. 1. Ask the user for ten (10) grades, and store the data in an array. Compute the average of all the grades. Print the original ten grades and the average. a. Declare an integer array with the name of “grades” of size 10 in the main function. b. Create a function called “getGrades” that prompts the User for the grades and puts them in an integer array. i. The function will receive...
The XYZ Company needs you to write a program that will allow them to enter the weekly sales for a salesperson and then the program will calculate things such as most sales (and what day on which they happened), least sales (and day on which they happened), total sales, and daily average. The program will need to do the following: • Validate the user input to ensure that it is not less than 0.0 (0.0 will be acceptable if there...
Write a C program with a function that displays a list of months, the number of days in each month, and the month with the least amount of days. Use a two-dimensional character array for the months and a one-dimensional integer array for the number of days in each month. Include another function that returns the index of the month with the least amount of days. Function Prototypes: void DisplayMonths( char months[ROW][COL], int days[ ROW ] ); int min( int...
C++ Program - Arrays- Include the following header files in your program: string, iomanip, iostream Suggestion: code steps 1 thru 4 then test then add requirement 5, then test, then add 6, then test etc. Add comments to display assignment //step 1., //step 2. etc. This program is to have no programer created functions. Just do everything in main and make sure you comment each step. Create a program which has: 1. The following arrays created: a. an array...
CT143 : Intro to C++ Lab 15: Array Practice Instructions Complete each of the C++ activities described below in a single source file Label each activity with its own heading using comments. Activities: 1) Favorite numbers a. Declare and initialize an array of 10 integers as a single statement using a name of your choice. b. Output the result of adding the 1st and 5th members of the array. C. Subtract the 4h member from 3 times the 10th member...
Write a program in C that will convert all 12 months' average temperature from Celsius to Fahrenheit. You need to create an array named aye jump and prompt the user to input average temperature in Celsius for all 12 months. After that, you need to develop a user temperatures from Celsius to Fahrenheit and pass the array as reference and convert all temperatures from Celsius to Fahrenheit. Next, compute the average temperature of the year and assign it to a...
using visual studio
2) For each of the following, write C++ statements that perform the specified task.. (Ref: classwork named pointer2) a) Declare a built-in array of type unsigned int called values with five elements, and initialize the elements to the even integers from 2 to 10. b) Declare a pointer vPtr that points to a variable of type unsigned int. c) Write two separate statements that assign the starting address of array values to pointer variable vPtr. d) Use...