Java Reference
In-Depth Information
EX 1.18 Java is case sensitive. What does that mean?
EX 1.19 What do we mean when we say that the English language is
ambiguous? Give two examples of English ambiguity (other than
the example used in this chapter) and explain the ambiguity.
Why is ambiguity a problem for programming languages?
EX 1.20 Categorize each of the following situations as a compile-time
error, run-time error, or logical error.
a. multiplying two numbers when you meant to add them
b. dividing by zero
c. forgetting a semicolon at the end of a programming statement
d. spelling a word incorrectly in the output
e. producing inaccurate results
f. typing a { when you should have typed a (
Programming Projects
Visit www.myprogramminglab.com to complete many of these
Programming Projects online and get instant feedback.
PP 1.1
Enter, compile, and run the following application:
public class Test
{
public static void main (String[] args)
{
System.out.println ("An Emergency Broadcast");
}
}
PP 1.2
Introduce the following errors, one at a time, to the program
from PP 1.1. Record any error messages that the compiler pro-
duces. Fix the previous error each time before you introduce a
new one. If no error messages are produced, explain why. Try to
predict what will happen before you make each change.
a. change Test to test
b. change Emergency to emergency
c. remove the first quotation mark in the string
d. remove the last quotation mark in the string
e. change main to man
Search WWH ::




Custom Search