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 B Lab Itty Bitty Airfreight IBA
Points
Topics:
Inheritance
Virtualization
Error Handling
Linked List
Lab
Utilizing the code from Lab 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 argumentsparameters and the same functionality.
Child class Boeing will have the information for our 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: max load is pounds
Child class Boeing will have the information for our new aircraft, which has the following specifications: Unit and type: Container, Pallet or Combo Flat: AKE, APE, AKC, AQP, AQF, AAP Containers, PP PP Pallets or CFQ CFX CFP Combo Flats.
Maxload: max load is pounds
Change private to protected in the Cargo class only.
Create two classes which inherit from the Cargo class: Boeing and Boeing
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 can hold up to pounds, and our can hold up to pounds.
The main function needs to call the input function and do nothing else except return to end the program.
The data file labdata.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 lines.
Use the labdata.txt file which will contain data like the following three lines of data; labdata.txt will have no more than 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.
whilegetlineinputFile cargostringread in one line of data, six or seven pieces
istringstreamn cargolSScargostring; place line in the input string stream
cargolSS type;
if typecompareCombolooking for Combo
cargolSS type abrv uld plane weight dest;seven pieces of data
type type type;valid Combo Flat, maybe
else
cargolSS abrv uld plane weight dest;six pieces of data
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
