I just installed class for my computer science class and i'm having a little trouble on the lists. I can print all my outputs on a list but i don't know how to add everything on that list.
For example, my project right now is to be able to add a number of test grades and then average them to the numerical value.
i have no problem inputing all the test grades into a list but i don't know how to set it up so that all the numbers i inputed into that list will be added altogether.
Offline
I don't have the blocks right now, but what you should do is use a variable as a counter, and another as the sum. Take the "counter"th number (start at 1, so first) and add that and the current sum (0 when start) and set it to the sum. Then change counter by 1 (to 2) and add the counterth (2nd) term to the sum. Put that in a repeat for X times, where X is the length of the list.
Offline
when gf clicked set [counter v] to (1) repeat (length of [list v] change [grade v] by (item (counter) of [list v]) change [counter v] by (1) endYou might have to adjust the script depending on how your grades are counted, but this is the basic script for adding all the numbers in list together. The total is stored in the grade variable.
Last edited by jji7skyline (2013-03-12 03:27:58)
Offline