
-----------------------------------
Krocker
Mon Nov 01, 2010 5:31 pm

Somebody Tell me What im doing Wrong
-----------------------------------
Hiya, im new to turing. I wanted to do something simple to start. here is my coding:


% Calculates the total Average of 4 classes
loop
    var average:real
    var average1:real
    var average2:real
    var average3:real
    var average4:real
    put "Enter Your Averages"
    colour(10)
    get average1
    colour (11)
    get average2
    colour (9)
    get average3
    colour (6)
    get average4
    colour (black)
   % Calculates the total average
    put "Your total average is"
    delay(2000)
    average:= (average1+average2+average3+average4)/4
   % Shows the total average 
    put average
    if average > 50 then 
    put "passing"
    else if average > 50 then
    put "failing"
    else 
    put "You are in the middle"
end if



When i go to play, i keep getting a compilation error message. im not sure wats wrong, i have tried different things. can someone plz help me and tell me wats wrong. thjx

-----------------------------------
TheGuardian001
Mon Nov 01, 2010 5:55 pm

Re: Somebody Tell me What im doing Wrong
-----------------------------------
If you look at what the error says, you'll see that you're missing an "end if"
If you look at it again, you'll see you're also missing an "End loop"

And finally,
[code]
if average > 50 then 
put "passing" 
else if average > 50 then 
put "failing" 
else 
put "You are in the middle" 
end if 
[/code]
Both of those conditions are > 50. The second one should be 