Hi all,
I wrote this function and it was working perfectly fine and then i came back a few days later and when i ran it the result wont show in the console like it used to before. I didn't change a single thing. Any insight would be greatly appreciated.
Grade_Analyzer <- function(S, R, P, B)
{
PB <- P+B
SB <- S+B
if(S < P)
{
print("The highest possible score you can get is P + B:")
print(PB)
if(R == PB)
{
new_score <- PB
print("score 1")
return(new_score)
}
else if(R < PB)
{
print("score 2")
return(R)
} #END ELSE IF
else if(R > PB)
{
print("score 3")
return(PB)
}#end Else IF
else
{
print("score 4")
return(R)
}#End Else
} #end IF
if(S == P)
{
if(R == SB)
{
print("score 5")
return(SB)
} #end IF
else
{
print("score 6")
return(R)
#End Else
}
if(S > P)
{
print("score 7")
return(S)
#end IF
}
} #end IF
}#End Function
P <- 22
B <- 30
S <- 54
R <- 67
Grade_Analyzer(S,R,P,B)