Computer Science Canada Beginner Turing Problem- variables??? |
Author: | mattpk [ Fri Dec 19, 2008 4:34 pm ] | ||||
Post subject: | Beginner Turing Problem- variables??? | ||||
Hi guys i am new to this forum I got interested in turing from my older brother. I am 11, so please when you explain this to me i understand. My brother challenged me to make a program that lets you get the person's marks and find the average. Simple enough, but very complicated now!
I run this, but then the program becomes finished after the user gives the variable numberofmarks. The loop isn't done for some reason, and the things after the loop aren't either. Mod Edit: Remember to use syntax tags! Thanks
|
Author: | dc116 [ Fri Dec 19, 2008 5:15 pm ] | ||
Post subject: | RE:Beginner Turing Problem- variables??? | ||
You have to first set countt and totallmark to 0
|
Author: | dc116 [ Fri Dec 19, 2008 5:21 pm ] |
Post subject: | RE:Beginner Turing Problem- variables??? |
Just to add something. You don't need the "average" variable, notice how you didn't even use it in your program. Also the program might be easier to understand if you use a counted loop. |
Author: | mattpk [ Fri Dec 19, 2008 5:24 pm ] |
Post subject: | RE:Beginner Turing Problem- variables??? |
Thank you dc116! |
Author: | Sam_sam [ Fri Dec 19, 2008 9:50 pm ] | ||
Post subject: | Re: Beginner Turing Problem- variables??? | ||
WOW!! I am impressed.. someone your age! That is awsome Anyway.. here is your finished and working code:
|
Author: | mattpk [ Sat Dec 20, 2008 10:14 am ] |
Post subject: | RE:Beginner Turing Problem- variables??? |
Thx, Sam_Sam, my brother inspired me and i have some practice coding from GML, anyone can do it if they put their mind to it |