Answer:
The chosen language in this instance is Java. The errors are explained below
Step-by-step explanation:
a. Lexical error, detected by the scanner: ‘aa’ is the string and not the character so ‘a’ will not be assigned the data type char.
b. Syntax error: Missing ‘;’ at the end of a statement.
c. A static semantic error, detected by semantic analysis: arr[10.5], the array will become out of bounds.
d. A dynamic semantic error, detected by code generated by the compiler:
int [] array = new int [10];
array [10] = 0;
The array here, has been assigned value 0 which is not with in the bounds.
e. An error that the compiler can neither catch nor easily generate code to catch (this should be a violation of the language definition, not just a program bug:
int a;
if (false)
{
x =10;
system.out.println(“Error”);
}
Here, the value of x is unreachable, yet error will not be reported.