Question: 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 =1; i =10; i = i +1
integer playerSelection
integer computerSelection
playerSelection = GetNextInput()
computerSelection = RandomNumber(1,3)
if playerSelection =1 and computerSelection =
Put "Player wins this round!" to output
playerScore = playerScore +1
else if playerSelection =2 and computerSelection =1
Put "Player wins this round!" to output
playerScore = playerScore +1
else if playerSelection =3 and computerSelection =2
Put "Player wins this round!" to output
playerScore = playerScore +1
else if playerSelection = computerSelection
Put "It's a tie!" to output
else
Put "Computer wins this round!" to output
computerScore = computerScore +1
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 4: In loop expression, unknown word 'i'" and im not sure how to fix this so it could work
[Attached image of full CORAL code]
 In the coding string integer playerScore integer computerScore for i =1;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!