ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 25 Apr 2017 My Price 8.00

CMPSC 101 LAB 13 – Fun with arrays

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!

Answers

(11)
Status NEW Posted 25 Apr 2017 07:04 AM My Price 8.00

-----------

Not Rated(0)