151k views
12 votes
If the programmer translates the following pseudocode to an actual programming language, a syntax error is likely to occur. Can you find the error?

Declare String 1stPrize
Display "Enter the award for first prize." Input 1stPrize
Display "The first prize winner will receive ", 1stPrize

User Bromind
by
4.2k points

2 Answers

3 votes

Answer:

begins with a number

Step-by-step explanation:

The first character of the variable name begins with a number. This is an error because most programming languages do not allow variable names to begin with numbers

User Leite
by
3.9k points
6 votes

Answer:

if, then, else

Step-by-step explanation:

you specified that if you enter award for 1st prize then it'll display 1st prize but you didnt specify what will happen if user does not enter 1st prize or what happens if 1st prize is not allocated. To me it looks like you got the 'if' and 'then' part correct but you dont have a 'else' part to it therefore it'll create an error when its not declared.

User Irudyak
by
3.9k points