CS 140 - Homework 1 - Due Thursday Sep 4

Name:___________________________________


In this homework you are going to create a Java program that has answers to the questions below. Turn in a printout of a file named HW1.java and also e-mail me the file as an attachment with a subject heading of HW1. Do this before the start of class on Thursday. You are also going to turn in this homework sheet with answers written in the space provided. So just to be clear here is what yo uturn in:

  1. Using DrJava determine what each of the Java code fragments below does. First, try and look at each statement and figure out what it does, then check your understanding by creating a simple Java program in a file named HW1.java and execute the statements. Save this file on your P: drive in your CS140 folder.
  2. Declare variables with reasonable types and assign them the appropriate values for the stated purpose. Add these to your HW1.java file.
  3. Copy the file
           T:\Harcourt\Fall2008\CS140\Fix_Me_Up_Because_I_Have_Problems.java
         
    to your CS140 folder on your P: drive and fix all of the errors in the program so that it properly reads the value of the radius of a circle and prints the area of the circle to the console pane. Turn in a printout of the fixed program.