CIS 163 AA - Java Programming I - Section 5811
Worksheet #2
Due
Monday, September 19, 2005
Name:
I. Definitions: please explain the following terms:
- statement
- casting
- concatenation
- string
- assignment statement
- pixel
- expression
- constant
- html
- escape sequence
II. Question or short essay
- What is operator precedence?
- What is the purpose of the import statement?
- What is the difference between the print() and the println()
method?
- What are the eight primitive data types?
- What does the new operator accomplish?
III. Programming
Exercises Write source code for the following:
- Write an application that reads from the keyboard a value that represents
a total number of seconds. Print the equivalent amount of time in hours,
minutes, and seconds.
- Write an application that reads the radius of a sphere from the keyboard
and prints its volume and surface area. Use the following
formulas, r represents the radius:
Volume = 4/3 π r3
Surface Area = 4 π r2