Chapter 7 - Programming exercise 2
File format : CH07_2A.HCPP,Save That.
#define CARHPP
#include "vehicle.hpp"
class car : public vehicle {
int passenger_load;
public:
void initialize(int in_wheels, float in_weight, int people = 4);
int passengers(void);
};
#endif
// Result of execution
//
// (this file cannot be executed)
Chapter 7 - Programming exercise 2
File format : CH07_2B.H.CPP,Save That.
#define TRUCKHPP
#include "vehicle.hpp"
class truck : public vehicle {
int passenger_load;
float payload;
public:
void init_truck(int how_many = 2, float max_load = 24000.0);
float efficiency(void);
int passengers(void);
};
#endif
// Result of execution
//
// (this file cannot be executed)