Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**IMPORTANT - PLEASE USE TEMPLATES WHEN CREATING TRAIN.CPP AND BUS.CPP** NOTE: IT SHOULD USE TEMPLATES, INTERFACES, AND OPERATOR OVERLOADING!! 1. a train and a bus

**IMPORTANT - PLEASE USE TEMPLATES WHEN CREATING TRAIN.CPP AND BUS.CPP**

NOTE: IT SHOULD USE TEMPLATES, INTERFACES, AND OPERATOR OVERLOADING!!

1. "a train and a bus must be able to store items of any type" - TEMPLATE

2. Trains and buses are "transporters". Any transporter MUST be able to be loaded with one item, unloaded with one item, empty-ed of all items, moved. They must also be able to report back whether or not they are empty and how many items they are carrying. - INTERFACE

3. people on the bus should "sit" from shortest to tallest - OPERATOR OVERLOADING

4. "a train must be able to report on the weight of all its cargo" - OPERATOR OVERLOADING

PROMPT-

Moving and shaking! We're going to create a program that moves trains carrying cargo and buses carrying people.

Trains and buses are "transporters". Any transporter MUST be able to be loaded with one item, unloaded with one item, empty-ed of all items, moved. They must also be able to report back whether or not they are empty and how many items they are carrying.

Additionally while a train and a bus must be able to store items of any type, in this project a train should store cargo and a bus should transport people. When cargo is loaded onto a train, it doesn't matter where it goes but people on the bus should "sit" from shortest to tallest. Also, a train must be able to report on the weight of all its cargo and a bus must be able to change its fair and give the total fair for all the people on the bus. When a train moves, it can display that it's reached the next destination. When a bus moves, it can display that it's reached the next stop.

Finally, each cargo must have a type and a weight and each person must have a name and a height.

The main driver of your program must create a train and load it with some cargo. It must also create a bus and let people board. All console input and output should occur in the main function (except for what's displayed in the move functions).

image text in transcribed

The goal of this project is to: 1. Review C++ 2. Review Templates 3. Review Interfaces 4. Review Operator Overloading Program Moving and shaking! We're going to create a program that moves trains carrying cargo and buses carrying people. Trains and buses are "transporters". Any transporter MUST be able to be loaded with one item, unloaded with one item, empty-ed of all items, moved. They must also be able to report back whether or not they are empty and how many items they are carrying. Additionally while a train and a bus must be able to store items of any type, in this project a train should store cargo and a bus should transport people. When cargo is loaded onto a train, it doesn't matter where it goes but people on the bus should "sit" from shortest to tallest. Also, a train must be able to report on the weight of all its cargo and a bus must be able to change its fair and give the total fair for all the people on the bus. When a train moves, it can display that it's reached the next destination. When a bus moves, it can display that it's reached the next stop. Finally, each cargo must have a type and a weight and each person must have a name and a height. The main driver of your program must create a train and load it with some cargo. It must also create a bus and let people board. All console input and output should occur in the main function (except for what's displayed in the move functions)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Recommend the key methods to improve service productivity.

Answered: 1 week ago