CIS 163 AA - Java Programming I - Section 5811
Worksheet #2
Due Monday, September 19, 2005

Name:

I. Definitions: please explain the following terms:

  1. statement

  2. casting

  3. concatenation

  4. string

  5. assignment statement

  6. pixel

  7. expression

  8. constant

  9. html

  10. escape sequence

II. Question or short essay

  1. What is operator precedence?

  2. What is the purpose of the import statement?

  3. What is the difference between the print() and the println() method?

  4. What are the eight primitive data types?

  5. What does the new operator accomplish?
III. Programming Exercises Write source code for the following:

  1. 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.

  2. 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