#WSQ10 Lists

This program uses vectors to store 10 numbers the user inputs in the program. The program will calculate the sum, average and standard deviation of those 10 numbers. To do this, vectors are indispensable since each one of them is assigned with one number. In this program we use a vector of size 10, that means, we have vector[0], vector[1], … , vector[9], to storage values in each one of them using a loop. To let the user to storage the values, you can do the following:

for(int i=0; i<=9; i++){

    cout<<“Enter number: “<<endl;

    cin>>n;

    nameofvector[i]=n;

}

and to to do the calculations I did something similar.

Here’s the link to my code:

https://github.com/alanvaldo/my-tc1017-stuff/blob/master/wsq10.cpp

CC BY 4.0 #WSQ10 Lists by Alan is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.