I'm new to this coding game, it's one of my uni modules. We are currently looking at loops. I'm on task 4 of 12 and just cant get my head around this one! Any thoughts appreciated, thanks :)
Write a program that uses loops to allow the user to enter a list of any 10 positive integer values before displaying their sum and average. The program should ensure that should a user enter a non-positive integer value then the number is disregarded. HINT: Use a ‘for loop’ to keep track of the numbers being entered and ’while loop’ to check for erroneous input.
Just what the hint says. Use a for-loop to ask 10 times. Look up what a for loop is, google and youtube is your best friend. Inside of it ask the question, and let the user answer and store that answer in a variable called sum or something. And each time the user answers, take that sum and add the answer to it. After 10 times, divide the answer by 10 and you will have your average. Once youre done with that you can think of the "only positive integer" error checker.
Get some code up and running and get started, if you get stuff on something feel free to post your code in this thread using code tags - http://www.cplusplus.com/articles/jEywvCM9/
And we'll be happy to help.