Posted by: KillEmAll July 17, 2008
Login in to Rate this Post:
0
?
I think he also needs to repeat those calculations until the user says stop or something. Here's the pseudo code never mind the syntax:
unsigned char countinueLoop
while (continueLoop){
copy paste brain malfunctions "main" code here
ask the user if he wants to continue
if no continueLoop = false
}
if you dont want to ask the user before hand how many scores he/she wants to enter for a particular set, you can use the same method described above to get scores. when he/she says no, stop gathering more scores.
unless u absolutely have to use 2 functions there is a better way to do this. you could get the average and the lowest number in one loop. i assume you can not have a negative test score and the least u can score is a 0.
ask the user for n test scores and store it in an array called numberoftests.
i guess in vb u can use the .size or .length function to get its length
initialize variables during declaration just to make things simpler
lowest=0;
sum=0;
for i = 0; i<numberoftests.size;i++
sum += numberoftests[i];
if numberoftests[i]<lowest{lowest = numberoftests[i]}
next i
avr = (sum-lowest)/(numberoftests.size-1)
later.
unsigned char countinueLoop
while (continueLoop){
copy paste brain malfunctions "main" code here
ask the user if he wants to continue
if no continueLoop = false
}
if you dont want to ask the user before hand how many scores he/she wants to enter for a particular set, you can use the same method described above to get scores. when he/she says no, stop gathering more scores.
unless u absolutely have to use 2 functions there is a better way to do this. you could get the average and the lowest number in one loop. i assume you can not have a negative test score and the least u can score is a 0.
ask the user for n test scores and store it in an array called numberoftests.
i guess in vb u can use the .size or .length function to get its length
initialize variables during declaration just to make things simpler
lowest=0;
sum=0;
for i = 0; i<numberoftests.size;i++
sum += numberoftests[i];
if numberoftests[i]<lowest{lowest = numberoftests[i]}
next i
avr = (sum-lowest)/(numberoftests.size-1)
later.