Robotics C++ Physics II AP Physics B Electronics Java Astronomy Other Courses Summer Session  

Sums

 

Part a

 

In the main, create a one-dimensional array consisting of the following numbers, in the order given  1  2  5  8  9. Hint: use an initializer list

 

¢ Print the contents, all on one line (with a space between so they can be distinguished), appropriately labeled

¢ Find and print the sum of the elements in the array, appropriately labeled

 

 

Part b

 

In the main, create a one-dimensional array consisting of 100 random integers in the range 1 to 50. write code that will accomplish the following - each appropriately labeled.

 

¢ Print the contents, 10 elements per line (with a space between so they can be distinguished)

¢ The sum of the elements in the array

¢ The average of the elements in the array

¢ The largest element in the array