PDA

View Full Version : If-Then-Else statements


andyhaus1057
Jul 27, 2009, 07:06 AM
How would I display an If-Then-Else statement that determines whether the points variable is outside the range of 9 to 51. If the variable holds a value outside this range it should display “Invalid points.” Otherwise, it should display “Valid points.”

karilynngodd
Oct 17, 2010, 11:20 AM
Hope you found the answer by now but here is what the pseudocode looks like :)


//This program is to determine whether the points are valid

//Declare variables
Declare real points

//Get the number of points
Display “Enter the number of points.”
Input points

//Determine if the number of points is valid
If points < 9 and points > 51 Then
Display “Invalid points”
Else
Display “Valid points”
End If

karilynngodd
Oct 17, 2010, 11:21 AM
Woah... that didn't turn out right like it was supposed to.

The ” are supposed to be quotation marks sorry