2010 Lab-14
Lab elements include:
• C++ Inheritance
• Base and derived classes
• Display of images
Getting started
Start with your 2010/e/vehicles.cpp program from Monday class.
Copy that program to 2010/e/mylab14.cpp
Follow along with Gordon on the big-screen.
follow the big-screen
To get your vehicle pictures...
1. Choose a vehicle that you like.
2. Find a picture of the vehicle online or on your phone.
3. Put a copy of the picture in your 2010/e folder.
Use sftp, filezilla, scp, or other method.
4. Give your image file small dimensions.
From the command-line:
convert pic.jpg -resize 320x240 pic.jpg
5. Name your images:
lab14a.jpg
lab14b.jpg
lab14c.jpg
etc.
Vehicle base class and derived classes Your program output will look like this...$ ./a.out Lab-14 Vehicles Menu -------------------- 1. Display vehicle-1 2. Display vehicle-2 3. Display vehicle-3 4. Display all vehicles 0. Quit programNote: Replace vehicle-1, 2, etc. with the names of your vehicles. You may add more vehicle types. Demonstrate the class when menu items are chosen. format of output:Vehicle-1 statistics: Number of passengers: nnn License number: ABC123 See image. Vehicle-2 statistics: Number of passengers: nnn Marine ID: MAR-12334-01-A1 See image.