Java Reference
In-Depth Information
4.
Syntactically incorrect: e, g, h. Logically questionable: a, d, f
5.
Yes, if you also reverse the comparisons:
if (richter > 3.5)
r = "Generally not felt by people";
else if (richter > 4.5)
r = "Felt by many people, no destruction";
else if (richter > 6.0)
r = "Damage to poorly constructed buildings";
. . .
6.
The higher tax rate is only applied on the income in the higher bracket.
Suppose you are single and make $51,800. Should you try to get a $200
raise? AbsolutelyȌyou get to keep 72% of the first $100 and 69% of the
next $100.
7.
When
x
is zero.
8.
if (!Character.isDigit(ch)) . . .
9.
7
10. An input of 0 should yield an output of ȓ
Generally not felt by
people
ȓ. (If the output is ȓ
Negative numbers are not
allowed
ȓ, there is an error in the program.