# -----------------------------------------------------------------------
# Ask user to make their selection
# -----------------------------------------------------------------------
[int]$selection = Read-Host "Please enter your selection (type 6 to EXIT)"
Write-Host ""
# -----------------------------------------------------------------------
# Compare their selection to the correct answer
# -----------------------------------------------------------------------
If (($displayhash.get_item($selection)) -eq ($hash.get_item(1)))
{
Write-Host "That is correct"
$Correct++
}
Elseif ($Selection -eq 6)
{
Write-Host "Thanks for playing"
$percent = ($correct + $incorrect)/$correct
Write-Host "You got $percent% Correct"
}
Else
{
Write-Host "That is incorrect"
$Incorrect++
}
}
No comments:
Post a Comment