
-----------------------------------
hugonibs2
Wed Apr 22, 2009 8:32 am

Two program problems
-----------------------------------
What is it you are trying to achieve?
I am trying to create a program that will sort the players into weight catagories.


What is the problem you are having?
I have two problems in this program. 

The first 
I would like to loop it with the variable that is entered in players. Is this possible? 

the second problem 
how would i fix this line 
if 60 < weight < 80 then 
I would like for it to choose this statement if the weight is bigger than 60 but less then 80. 







loop 
var weight : real 
var players : int 

put "How many players are on your team? ".. 
get players 
put "please enter your weight in kg: ".. 
get weight 
if 60 < weight < 80 then 
put "You are at a medium weight range" 
elsif weight > 80 then 
put "You are at a hevyweight weight range" 
elsif weight < 60 then 
put "You are at a lightweight weight range" 
end if 



Please specify what version of Turing you are using
4.1

-----------------------------------
BigBear
Wed Apr 22, 2009 1:44 pm

RE:Two program problems
-----------------------------------
if 60 < weight < 80 then 

Must be if weight >60 and weight  80 then 
put "You are at a hevyweight weight range" 
elsif weight < 60 then 
put "You are at a lightweight weight range" 
end if 
end loop



I excluded the following code from the project.


var players : int 

put "How many players are on your team? ".. 
get players 


You did not give a specific purpose for this so I decided to remove it.
