Question: DO NOT NEED TO DO HONORS SECTION - Arraps Submission information Submit this assignenent by following the instructions given by your TA. SUBMIT ONIY the

 DO NOT NEED TO DO HONORS SECTION - Arraps Submission information
DO NOT NEED TO DO HONORS SECTION

- Arraps Submission information Submit this assignenent by following the instructions given by your TA. SUBMIT ONIY the , file ine a.out or executable file is required). All of the lab assignments must be submitted before the end of the lab. Use the following subisit cammand: mues submit celass cassignment names dilename? For example: mucs submit 1060 lab6 lab6. Description For the lab assignment, you need to create an array of integers that is initialiped to the odd numbers from 1 through 99. Print out this aetay to show that it contains all of the correct numbers. Next, calculate the total of the elements indexed by an even number (that is, every other one starting with element zero) and print that along with the correspondiog average. Finally, calculate the total of the elements indexed by an odd number (that is, every other one starting with element one) and print that total along with the corresponding average for this set of elements. Important notes: - Global variables are not allowed. - You mast use looping to calculate your totals and averages. For example, you may not just hard-code an expression that involves the 0element of the array, the 2d element of the array, the 4th element of the array, etc. Honors Extension In addition to the non-honors requitements, you are to create a 2 od array that is initialised to the even numbers from 0 through 98 . Print out that array as well to show that it contains all of the correct numbers. Print out the product of each element of the first array and the corresponding element of the second array. Basic Requirements fyou will lose points if you do not have these) Your program should have a comment header at the top of the fle that provides the lab number, the course, the semester, the author, and the date when the program was written. This comment header should be nicely formatted and easy to read. In addtition, your code should have appropriate comments throughout the program, not exclusively in the comment header. Al code should be indented properly and should be easy to read. Page 1 of 4 Sample Non-honors Output Jimrajiakbeastcamon: / Cssioso/F520225 ,/A.out Arrayd elenents: arrayd (0)=1, array1 [1]3,array1[2]=5, array 1[3]=7, array [4]=9, array1 (5]=11, array1 6]13, array1[7]-1s, array1 (3)=17, array1[9]-19, array1[io =21, array1(11)-23, array1 (12)=25, arrayi [13]=27, array1[14] =29, arrayi [15] =31, array1 [16]=33, arrayd (17) -35, array1 18) -37, array1 (19) =19, arrayl 20)-41, array1 (21)=43. array1 22)=45, array1 (23) =47, array1(24) =49, arrayi 25) =51, array1(26) =53, array1(27) u55, array1(28) =57, array1 (29) =59, array1 (30)=61, array1 (11)=63, array1 (32) -65 , array1 (33) =67, array1 (34)=69, arrayd (35)=71, array1 (36)=73, array1 37)75; array1 (38)77; array1 (39)79; arrayl 40)81; array1 (41)83; arrayd 47]=95, array1(48)=97, array1[49)-99, total of arrayd even elenents =1225, average =49,00 Total of arrayi odd elenents = 1275, average - 51.00

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!