The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 2 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
need in C++. We are learning arrays. No DO loops please.
CMPSC 101
LAB 13 – Fun with arrays
Write a program that reads 15 numbers (integers) from stdin, then displays the following:
The total of the even numbered values (2nd value+ 4th value+ etc..) The total of the odd numbers (1st value + 3rd value + etc...)
The total of every 5th number.
Note that “even numbered values” mean the 2nd value, 4th value, etc., not “2”, “4”, “6”, etc.
For example:
The data is:
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14
The even values are:
1+3+5+7+9+11+13 = 49
The odd values are:
0+2+4+6+8+10+12+14 = 56
Every fifth values are:
4+9+14 = 27
Another example:
The data is:
7,3,9,11,25,47,98,45,76,21,99,35,67,83,12
The even values are:
3+11+47+45+21+35+83 = 245
The odd values are:
7+9+25+98+76+99+67+12 = 393
Every fifth values are: 25+21+12 = 58
Run it 5 times with different data, including the two above examples. Then, following the instructions in the “How to package and submit your labs” video, package up your work. Double check to confirm that the package is complete (i.e., all the header info, the code, the screen shots, the output, etc.), and then submit it to the drop box.
Next, go back and confirm that the submission is in the drop box!
----------- He-----------llo----------- Si-----------r/M-----------ada-----------m ----------- ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------