Hands-on 4a

Using classes

Start code: session4-start.tar.gz

Program testCar

  • Download the start code and unpack it in your working area (directory Project):
$ tar xzvf session4-start.tar.gz
  • Inspect the Car class header file, Car.h, and the testCar.cxx program (open these files in your editor), then compile it an run:
$ g++ Car.cxx testCar.cxx -o testCar
$ ./testCar

Program testPoint

  • Inspect the Point class header file, Point.h, and compile the testPoint.cxx program.
$ g++ Point.cxx testPoint.cxx -o testPoint
  • Complete the testPoint.cxx program: implement a code according to the indications in each commented line. After completing each line, compile and run the test program. Get inspired with the testCar.cxx program inspected in the previous step.