Back to index

plt-scheme  4.2.1
Package Functions | Package Attributes
Truck Class Reference
Inheritance diagram for Truck:
Inheritance graph
[legend]
Collaboration diagram for Truck:
Collaboration graph
[legend]

List of all members.

Package Functions

 Truck (String make, int miles, int numDoors, boolean bed, double basePrice)
int milesTraveled ()
String makeAndModel ()
Automobile travel (int miles)
double price (int year)
 Truck (String make, int miles, int numDoors, boolean bed, double basePrice)
String makeAndModel ()
double price (int year)

Package Attributes

String make
int miles
int numDoors
boolean extendedBed
double basePrice

Detailed Description

Definition at line 80 of file beginnerTest.java.


Constructor & Destructor Documentation

Truck.Truck ( String  make,
int  miles,
int  numDoors,
boolean  bed,
double  basePrice 
) [inline, package]

Definition at line 87 of file beginnerTest.java.

                                                                              {
    this.make = make;
    this.miles = miles;
    this.numDoors = numDoors;
    this.extendedBed = bed;
    this.basePrice = basePrice;
  }

Here is the caller graph for this function:

Truck.Truck ( String  make,
int  miles,
int  numDoors,
boolean  bed,
double  basePrice 
) [inline, package]

Definition at line 74 of file intermediateTest.java.

                                                                              {
    this.make = make;
    this.miles = miles;
    this.numDoors = numDoors;
    this.extendedBed = bed;
    this.basePrice = basePrice;
  }

Member Function Documentation

String Truck.makeAndModel ( ) [inline, package]

Implements Automobile.

Definition at line 82 of file intermediateTest.java.

                        {
    if (this.extendedBed) {
      return this.make.concat("Extended");
    } else {
      return this.make.concat(String.valueOf(this.numDoors));
    }
  }
String Truck.makeAndModel ( ) [inline, package]

Implements Automobile.

Definition at line 96 of file beginnerTest.java.

                        {
    if (this.extendedBed) {
      return this.make.concat("Extended");
    } else {
      return this.make.concat(String.valueOf(this.numDoors));
    }
  }

Here is the caller graph for this function:

int Truck.milesTraveled ( ) [inline, package]

Implements Automobile.

Definition at line 95 of file beginnerTest.java.

{ return this.miles; }
double Truck.price ( int  year) [inline, package]

Implements Automobile.

Definition at line 89 of file intermediateTest.java.

                           {
    // Uncomment to test runtime error behavior
    //return this.basePrice - (2 * (this.basePrice / (2006 -year)));
    if (year == 2006) {
      return this.basePrice;
    } else {
      return this.basePrice - (2 * (this.basePrice / (2006 - year)));
    }
  }
double Truck.price ( int  year) [inline, package]

Implements Automobile.

Definition at line 106 of file beginnerTest.java.

                           {
    // Uncomment to test runtime error behavior
    //return this.basePrice - (2 * (this.basePrice / (2006 -year)));
    if (year == 2006) {
      return this.basePrice;
    } else {
      return this.basePrice - (2 * (this.basePrice / (2006 - year)));
    }
  }

Here is the caller graph for this function:

Automobile Truck.travel ( int  miles) [inline, package]

Implements Automobile.

Definition at line 103 of file beginnerTest.java.

                               {
    return new Truck(this.make, this.miles + miles, this.numDoors, this.extendedBed, this.basePrice);
  }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

double Truck.basePrice [package]

Definition at line 85 of file beginnerTest.java.

Definition at line 84 of file beginnerTest.java.

String Truck.make [package]

Definition at line 81 of file beginnerTest.java.

int Truck.miles [package]

Reimplemented from Auto.

Definition at line 82 of file beginnerTest.java.

int Truck.numDoors [package]

Definition at line 83 of file beginnerTest.java.


The documentation for this class was generated from the following files: