/* Create a program that checks user name and password. */
var username, password : string
var validLogin : boolean
validLogin := false
loop
put "User Name: " ..
get username
put "Password: " ..
get password
put "" % add an extra line for nice output
if (username = "bob") and (password = "robert") then
validLogin := true
elsif (username = "bill") and (password = "william") then
validLogin := true
elsif (username = "tim") and (password = "timothy") then
validLogin := true
end if
exit when (validLogin = true)
end loop
put "Access granted"
Comments (0)
You don't have permission to comment on this page.