CIS 1068 Assignment 8
Warm Up with Objects

Assigned: Saturday, March 21
Due: Friday, April 3

70 points

Car (35 points)

Implement a class Car, which contains the fields (5 points):

Implement at least the following methods within the Car class (5 points each):

For example, we should be able to do something like the following:

    Car oldJunker = new Car("Ford", "Pinto", 1972, 17.5, 132480, 12, 8); // creates a new Car object
    oldJunker.drive(5); // drives the Car 5 miles
    oldJunker.fillTank(1); // put in a gallon of gas
    System.out.println(oldJunker.getFuelRemaining()); // prints the amount of fuel left
    System.out.println(oldJunker); // prints the attributes of the car to the screen

Write a short driver program to test your Car class with a short array of Cars (5 points).

YouTube video (35 points)

Create a class that models a YouTube video. It should contain the following fields:

Implement at least the following methods:

Create a short driver progam (YouTubeVideoTest) that

Note about files

There are several possible ways to organize your files for this assignment. The simplest and recommended way would be that you have four files in two different Eclipse projects:

  1. Car.java - contains a Car class definition (i.e., what we've been calling a blueprint or a cookie cutter)
  2. CarMain.java - contains your test program
  3. Vid.java - contains a Vid class definition
  4. VidMain.java - contains a test program

what to submit

Please upload your .java files to Canvas.

It's a good idea to confirm through the Canvas submission page that what you've intended to submit was uploaded. We will grade what you submit. If you submit a corrupted, empty, or otherwise incorrect file, this is what we'll grade. It is your responsibility to verify through the Canvas submission page that you've submitted the correct files and that they were uploaded properly.

If you're unsure about how to submit, please consult Canvas' tutorial or see us for help.