Question: plase make sure that its fit a . cpp file because this I the feedback. got syntax error because you used . h files which

plase make sure that its fit a .cpp file because this I the feedback. got "syntax error because you used .h files which were not included in what was sent through Canvas.
Canvas does not manage multiple .h files well.
That's why you were restricted to .cpp. You need to combine your .cpp file with your .h files,
removing the includes and then compile and execute the single .cpp file to make sure that it
works." CIS 22B Lab 5 Itty Bitty Airfreight (IBA)
1000 Points
Topics:
Inheritance
Virtualization
Error Handling
Linked List
Lab 5
Utilizing the code from Lab 4.2, replace your Cargo class with a new base class. This will be the base for two classes created through inheritance. The rewritten Cargo class will need to have a pure virtual function to have it redefined in the child classes. This means that the Cargo class will become an abstract class. You will be able to use many parts of the new Cargo class in the child classes since they will have the same arguments/parameters and the same functionality.
Child class Boeing 737 will have the information for our 737 aircraft, with the addition of maxload.
Unit and type: Container, Pallet or Combo Flat: AYF, AYK, AAA, AYY Containers, PAG, PMC, PLA Pallets or CFE, CFK, CFM Combo Flats.
Maxload: 737 max load is 46000 pounds
Child class Boeing767 will have the information for our new 767 aircraft, which has the following specifications: Unit and type: Container, Pallet or Combo Flat: AKE, APE, AKC, AQP, AQF, AAP Containers, P1P, P6P Pallets or CFQ, CFX, CFP Combo Flats.
Maxload: 767-300 max load is 116000 pounds
Change private to protected in the Cargo class only.
Create two classes which inherit from the Cargo class: Boeing737 and Boeing767.
Each class will need to inherit a default constructor, a copy constructor, a constructor that has six parameters and all the getters and setters. Only one more function will be built in each class, the max weight function; all the rest will be inherited.
The unit and type data are different for each class as is the aircraft type. Maxload is provided for both aircraft. Our 737 can hold up to 46000 pounds, and our 767 can hold up to 116000 pounds.
The main function needs to call the input function and do nothing else except return to end the program.
The data file lab5data.txt is provided in Canvas for your use. Your program will be tested with different data, but the format Is guaranteed to be correct, and not to exceed 20 lines.
* Use the lab5data.txt file which will contain data like the following three lines of data; lab5data.txt will have no more than 20 lines of data
* All weights are in pounds, don't worry about kilograms.
* In the input function, declare an object of type ifstream named inputFile, which we will use to read from the file.
* At the beginning of the code for the input function, open the file. If the open fails, tell the user that the file name is not valid and give the user another opportunity to enter a correct file name..
* In all other reads within the input function, remove the user prompt and read from the inputFile object, rather than reading from the stdin object; that is, use \(>\). This is good code for reading data from a file and parsing the data into the appropriate variables for use in object creation. You will want to use a try block for exception handling to get a correct file name.
```
while(getline(inputFile, cargostring))///read in one line of data, six or seven pieces
{
istringstream_n cargolSS(cargostring); ///place line in the input string stream
cargolSS >> type1;
if ((type1.compare("Combo"))==0)///looking for Combo
{
cargolSS >> type2>> abrv >> uld >> plane >> weight >> dest;///seven pieces of data
type1= type1+""+ type2;///valid Combo Flat, maybe
}
else
{
cargolSS >> abrv >> uld >> plane >> weight >> dest;///six pieces of data
}
```
plase make sure that its fit a . cpp file because

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!