Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In the coding string integer playerScore integer computerScore for i = 1 ; i = 1 0 ; i = i + 1 integer playerSelection
In the coding string integer playerScore integer computerScore for i ; i ; i i integer playerSelection integer computerSelection playerSelection GetNextInput computerSelection RandomNumber if playerSelection and computerSelection Put "Player wins this round!" to output playerScore playerScore else if playerSelection and computerSelection Put "Player wins this round!" to output playerScore playerScore else if playerSelection and computerSelection Put "Player wins this round!" to output playerScore playerScore else if playerSelection computerSelection Put "It's a tie!" to output else Put "Computer wins this round!" to output computerScore computerScore end if Put "Player score: to output Put playerScore to output Put to output Put "Computer score: to output Put computerScore to output Put to output end for if playerScore computerScore Put "Player wins the game!" to output else if playerScore computerScore Put "Computer wins the game!" to output else Put "The game is a tie!" to output end if I keep getting a the message "Line : In loop expression, unknown word i and im not sure how to fix this so it could work
In the coding string
integer playerScore
integer computerScore
for i ; i ; i i
integer playerSelection
integer computerSelection
playerSelection GetNextInput
computerSelection RandomNumber
if playerSelection and computerSelection
Put "Player wins this round!" to output
playerScore playerScore
else if playerSelection and computerSelection
Put "Player wins this round!" to output
playerScore playerScore
else if playerSelection and computerSelection
Put "Player wins this round!" to output
playerScore playerScore
else if playerSelection computerSelection
Put "It's a tie!" to output
else
Put "Computer wins this round!" to output
computerScore computerScore
end if
Put "Player score: to output
Put playerScore to output
Put
to output
Put "Computer score: to output
Put computerScore to output
Put
to output
end for
if playerScore computerScore
Put "Player wins the game!" to output
else if playerScore computerScore
Put "Computer wins the game!" to output
else
Put "The game is a tie!" to output
end if
I keep getting a the message "Line : In loop expression, unknown word i and im not sure how to fix this so it could work
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started