Homework 1: Part 1

Due Thursday June 23, 5:30pm


This portion of Homework 1 is expected to be hand written. A drawing program can be used instead, but the homework must be turned in as either a printed copy, a pdf file, or a ps file.


  1. What prior programming experience do you have? If you have prior experience: please list the languages you know, the approximate size of the largest program you have written, and generally what it does.
  2. List some information that is important in determining whether or not an airplane is within range of a given destination.
  3. a) List some information that is important about a movie in order to assist a rental store in keeping track of their inventory.
  4. b) Create a formal data design representing a movie using the information in 3-a
  5. Create a formal data design to represent a city, so that someone can determine the distance (as a bird flies) between two cities.
  6. A taco vendor needs to know whether or not each taco weighs enough. A taco may have pork, beef, vegetables, cheese, beans, etc. Every taco has exactly three fillings. Create a formal data design of a taco.
  7. A building manager is making a directory of offices for staffing, cleaning, and decorating tasks. Create a formal design of an office that will contain information to support all of these tasks.
  8. a) Create a formal data design for the following Java class:
    class Bird {
      int age;
      String color;
      Bird( int age, String color) {
        this.age = age;
        this.color = color;
      }
    }

    b) Extend the design for Bird so that it could be used to categorize birds into either small or large
    c) Using the class from 7-a, demonstrate the Java representation for a yellow, 3 year-old bird and a red, 5 year-old bird.
    d) Demonstrate the Java to add 5 to the ages of the two birds in 7-c (i.e. 5 + ???, fill in the question marks)
  9. a) Create a formal data design for this Java class:
    class Planet {
       double avgDistToSun;
       int population;
       Planet( double avgDistToSun, int population) {
          this.avgDistToSun = avgDistToSun;
          this.population = population;
        }
    }

    b) The class in 8-a is going to be used to compute the population density of the planet. Is there sufficient information contained in the data? If not, extend the data.
    c)Explain what changes need to be made to the Java class to contain the same information as the updated data design from 8-b
    d)Demonstrate the Java that adds the populations of two Planets (Do not add a method)