\
a ← expression
DISPLAY (A)
A syntax error in this example occurs because the second statement attempts to display the variable A, which is not the defined variable. Variable names are case sensitive. Therefore, while the variable with a lowercase a in lowercase is defined by the first statement, the variable with a capital A in the second not defined. Therefore, the rules of the programming language were violated
\
\
DISPLAY (5/0)
\
In this example, there is no syntax error, because the language of the code is used correctly. However, this causes a runtime error because you cannot divide by zero. The execution of the program will halt at this line.
\
a 95
IF (a > 90)
DISPLAY("You got an A.")
IF (a > 80)
DISPLAY("You got a B.")
IF (a > 70)
DISPLAY("You got a C.")
\
\
You got an A.
You got a B.
You got a C.
\
This logic error occurs because the students score is also greater than 80 and 70 with no restriction that prevents multiple grades from being printed.
\
x - 2000*365
DISPLAY (x)
\
The result is of the multiplication is a large number. In many languages, this product would be large enough to be outside the range of certain data types. Therefore, if x is defined as a variable of one of those data type, this multiplication will cause an overflow error.
\
\