Computer Science Canada Arrays And Counter - |
Author: | silent_k [ Tue May 31, 2005 6:53 pm ] | ||
Post subject: | Arrays And Counter - | ||
Hi I have to create program using array and counters that asks the user to input a bunch of numbers(marks)from 0-10 and as soon as a certain value is entered (such as -45) then the program stops asking the user to input a mark and displays how many students in this case has the same mark (2 students have 4 marks if you enter 4 twice etc.) So far i have done the following but I don't know is the what becomes strint(l) after the error trap code is finished.Please help!
|
Author: | wtd [ Tue May 31, 2005 7:23 pm ] | ||||
Post subject: | |||||
Let's clean that up a bit.
Now, it seems you've got a decent grip on checking for good input. Let's move that into a function.
Does this make sense? |
Author: | [Gandalf] [ Wed Jun 01, 2005 11:02 am ] | ||
Post subject: | |||
wtd, you're using functions a lot now, not sure if everyone will understand . Also, you're missing an "if" after "end" It should be:
|
Author: | wtd [ Wed Jun 01, 2005 12:36 pm ] |
Post subject: | |
[Gandalf] wrote: wtd, you're using functions a lot now, not sure if everyone will understand .
Also, you're missing an "if" after "end" Thanks for catching that. And they should understand functions. Functions are critical and the only way to "get" them is to see them used and to use them. |