#WSQ10 LISTS

Well for this WSQ we had to create a list of numbers where the user inputs 10 numbers, and from there you must add them all, get the average, and get the standard deviation. But fiest Mr. Bauer ask us why we uses “namespace std” if we didn’t know what that meant, therefore he showed us that we should use what we know, in this case “include std::cout,cin, endl” so that’s what we did. And he also gave us the first Function we needed for the program.Screenshot13.1

from the first function we had to imagine how the 2nd and 3rd would look like, I wondererd for so long until I went onto my m8 Dario’s blog, and checked if he had done another function for the average, which was the case, but contrary of what I had thought, he used last function in the new function so he didn’t have to add the numbers again. And for the standard deviation we had to do one Function totally different.

Screenshot13.2.png

Finally the main was easier that all, you just had to put all the variables on the float, add a constant for the Numbers and say that the number to be inputed would be until it became equal to 10 (i=10) so each time a number would be inputed, the counter would go (i++).

The you just have to print the answers, using the functions with the variables (x, numberofNumbers) and end, between each line.Screenshot13.3

Here is my code in case you might need it.

 

CC BY-SA 4.0 #WSQ10 LISTS by canadamike17 is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.