You are Fred Smith, the best Pitman ever to grace the Indianapolis 500, hands down! And today is the day of the big race. You have all your wrenches shined, your screwdrivers sharpened, your gauges set and calibrated - hell, you even have clean underwear on. Today, you are manning the pits for everyone! There is only one pitman and you are he! So you need to make sure that you are working on the right car. If you can write the holder class which holds onto a Racecar, then you will help yourself be handy to victory.
This laboratory exercise is designed to help you understand the holder pattern. The holder pattern is best described as a pocket that can only have one thing in it at a time. So, when I go to put myhand in the pocket, whatever is the current object is what I get out of this pocket. Unlike a human pocket however, this holder can have its object changed by anyone who has a reference to the holder. So, if your mom said put this piece of bubble gum in the pocket, that is the current object. What you need to do is fill in the two methods in the holder class. To understand how everything is going on in the program, you should read the other classes to understand how everything is working. The TA's running this lab will help answer all questions involved. Then, once you understand the idea, filling out the two methods will be a breeze, and the Pitstop at the Indy 500 will be saved.
This lab will help you understand many things (besides the meaning of life and what keeps mayonaise fresh). Such as:
All of the work you will be doing will be in package Pitstop. The classes there are:
Good Luck!