Posted: Wed Oct 09, 2019 6:43 pm Post subject: Having problems getting my arrays to work
What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
What is the problem you are having?
So for part of my program, I need to make an array. I have looked at the array tutorial page but I still can't understand where I am going wrong. The code also needs a way to find the average, above average and below average numbers. I have not yet made that for fear that I might screw this up even more.
Describe what you have tried to solve this problem
I have looked at the tutorial page and tried to add my own stuff to suit my needs.
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Turing:
var counter :int:=0
put"How many numbers would you like to enter?"..
get counter
var countHighLow :array1.. counter ofint
for i :1.. countHighLow
put"Enter a number." get countHighLow(i):*
endfor
Please specify what version of Turing you are using
Latest version on this site
Sponsor Sponsor
Clayton
Posted: Tue Oct 15, 2019 4:40 pm Post subject: RE:Having problems getting my arrays to work
Look carefully at the start of your for loop:
Turing:
for i :1.. countHighLow
Try to think of what
Turing:
1.. countHighLow
is actually saying, and carefully think of what countHighLow represents in this context.