Programming Languages - Review for Test
- Explain the difference between machine language and a high
level language.
- Explain the difference between assembly language and machine
language.
- If a CPU (microprocessor) can only execute machine code, outline
the process
that enables a Java program to be executed by the CPU.
- Explain the brilliant idea that John von Neumann suggested that is still
used
in virtually every modern computer.
- Approximately when were each of these invented:
(a) the first electronic
computer
(b) the fist compiler
(c) the first microprocessor
(d)
the first personal computer
- Structured High Level Languages are belong to the 3rd generation
of
programming languages. Outline what we should expect from
the 4th generation.
- List the following in order from oldest to newest:
Java
Basic C++
Fortran
- Outline two advantages of Object Oriented Program over structured
programming.
- Explain 3 differences between a compiler and interpreter.
- Outline the difference between syntax and semantics, including
specific examples.
- Explain why the Java Virtual Machine is essential for ensuring
portability
of Java programs.
- Explain the difference between a keyword and a variable identifier.
13. State the output of the following code fragment:
String command = "Add 2 plus 4";
String[] words = commands.split("\\s");
output(words.length);
output(words[2]);
14. Rewrite this method so that it would respond correctly
to the command: "add 12 and 20"
public void tryAdd(String command)
{
String[] info = command.split();
if (info[0] == "add" and info[2] == "and")
{
int a = Integer(info[1]);
int b = Integer(info[2]);
int c = a + b;
output(c);
}
}
15. Explain why it makes sense to use an interpreter for JavaScript
rather than a compiler.