Calculating a series of numbers on Turing
Author |
Message |
huskiesgoaler34
|
Posted: Fri Oct 01, 2010 7:50 pm Post subject: Calculating a series of numbers on Turing |
|
|
Hey Everyone,
I am new to the board and this will be my first post on the CSC. I am very excited about my Grade 10 Computer Science and I find myself strong in the area of computers. I have just started using turing two weeks ago and everyday I am getting stronger. This is the first time that I have done programming and I am starting to get the hang of it. Please help me out though. I was assigned to do 8 different programs and I am stuck on the last one. Can any of you help me get started by giving me suggestions on how to do it. I am very tired right now so I could probably do the question but like I said I am very tired right now. Here is the question.
Write a program that asks the user to enter a series of numbers until the user wishes to quit. At the end, the program should tell the user the sum and average of all the numbers entered in.
Thanks everybody,
Have a great weekend!
HuskiesGoaler |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DtY
|
Posted: Fri Oct 01, 2010 8:49 pm Post subject: RE:Calculating a series of numbers on Turing |
|
|
You need to keep track of two things: the total entered, and the number of numbers the user has entered.
Use a loop to get numbers from the user, until they wish to quit (not sure how you'd figure that out, the question probably mentions something like stop when a zero is entered?).
At the end, the total is easy enough, you already have it. How can you get the average with what you've kept track of? |
|
|
|
|
|
huskiesgoaler34
|
Posted: Sat Oct 02, 2010 8:35 am Post subject: RE:Calculating a series of numbers on Turing |
|
|
Thanks DtY,
I am going to try to create a loop and then ask the user something like "Do you wish to continue? Y/N..I appreciate the quick reply. |
|
|
|
|
|
|
|