Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class freight
- {
- public:
- freight(string set_address, float set_length, float set_width, float set_height, float set_weight);
- string address;
- float length;
- float width;
- float height;
- float weight;
- float cost;
- };
- class satchel: public freight
- {
- public:
- satchel(string set_address, float set_length, float set_width, float set_height, float set_weight);
- };
- freight::freight (string set_address, float set_length, float set_width, float set_height, float set_weight)
- {
- address = set_address;
- length = set_length;
- width = set_width;
- height = set_height;
- weight = set_weight;
- }
- satchel::satchel (string set_address, float set_length, float set_width, float set_height, float set_weight) : freight (set_address, set_length, set_width, set_height, set_weight)
- {
- cost = weight*1.20;
- }
- carton::carton (string set_address, float set_length, float set_width, float set_height, float set_weight) : freight (set_address, set_length, set_width, set_height, set_weight)
- {
- cost = weight*1.80;
- }
- pallet::pallet (string set_address, float set_length, float set_width, float set_height, float set_weight) : freight (set_address, set_length, set_width, set_height, set_weight)
- {
- cost = weight*2.50;
- }
Advertisement
Add Comment
Please, Sign In to add comment