HELP WANTED C++ PLEASE. Using the code from lab 4.1, add the ability to read from a file. Modify the

HELP WANTED C++ PLEASE. Using the code from lab 4.1, add the ability to read from a file. Modify the
  HELP WANTED C++ PLEASE. Using the code from lab 4.1, add the ability to read from a file. Modify the input function: * Move the input function out of the Cargo class to just below the end of the Cargo class * At the bottom of the input function, declare a Cargo object named temp using the constructor that takes the six parameters. * Use the Cargo output function to print the Cargo object. * Call the input function from the main function with no arguments. Remove the rest of the code from main 3. Create a file and use it for input. This is good because you will be using the input many times. * Create a file named cardata4.txt (or use the one provided), containing the following three lines of data. If you create your own, make sure to follow the format below: Pallet PAG PAG45982IB 737 4978 OAK Container AYF AYF23409AA 737 2209 LAS Container AAA AAA89023DL 737 5932 DFW * All weights are in pounds, don’t worry about kilograms. You may comment out that code. * 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, send a message to stderr and exit the program. * In all the reads within the input function, remove the user prompt and read from the inputFile object, rather than reading from the stdin object. * Hint: We need to use getline when reading the strings. using >> skips leading white space before reading the data. getline does not skip this leading whitespace. So, before using getline use the following code: while(inputFile.peek() == ' ') inputFile.get(); peek looks at the next character you are about to read. If it is a space, get is used to read the space character, to get it out of the way. Your output will then be much neater. * Use a loop to read each line from the file. To do this use a while loop including all the reading in the input function, as well building and output of the Car. Hint: you can do this with the following while statement: while(inputFile.peek() != EOF) or use this form while(inputFile >> type) The peek function will return EOF if there is no next character. * At the bottom of the input function, close the file. Put an eye catcher before the beginning of each function, class, and the global area: // class name function name comment(if any) ************************************************* MY LAB 4.1 CODE  #include #include using namespace std; // class to define the parameters of the load; class load{ //private members private: string uId; string abbreviation; string uldid; string aircraft; double weight; string destination; //public functions public: //default constructor //doesnt require any function body load(){} //copy constructor load(const load &l); //mutator function void input(); //this function prints the elements in object void output(); //friend function to convert kilo to pounds friend void kilotopound(load &l); //friend function to compare two objects friend bool operator==(load& obj1,load& obj2); }; int main (){ //Object unit1 load unit1; unit1.input(); // Calling separate function for taking input. unit1.output(); // Calling separate function for displaying output. //defining a new object unit2 on stack using copy constrcutor load unit2(unit1); cout < "nnobject="" 2="" made="" using="" copy="" constructor:=""> //output second object unit2 unit2.output(); //Creating default object unit3 load unit3; cout <> //Testing overloaded operator if (unit1 == unit2) cout < "nunit1="" is="" the="" same="" as="" unit2=""> else cout < "="" nunit1="" is="" not="" the="" same="" as="" unit2=""> if (unit2 == unit3) cout < "="" nunit2="" is="" the="" same="" as="" unit3=""> else cout < "="" nunit2="" is="" not="" the="" same="" as=""> return 0; } //copy constructor definintion load::load(const load &l){ uId = l.uId; abbreviation = l.abbreviation; uldid = l.uldid; aircraft = l.aircraft; weight = l.weight; destination = l.destination; } void load::input(){ string x=””; double w=0; char ch; cout<"enter uid:="" ";="" cin="">>x; this->uId = x; cout<"enter abbreviation:="" ";="" cin="">>x; this->abbreviation = x; cout<"enter uldid:="" ";="" cin="">>x; this->uldid = x; cout<"enter aircraft:="" ";="" cin="">>x; this->aircraft = x; cout<"enter weight:="" ";="" cin="">>w; cout < "is="" this="" weight="" in="" kilograms?="" (y/n):=""> cin >> ch; this->weight = w; cout<"enter destination:="" ";="" cin="">>x; this->destination = x; // if the user wants weight to be converted to pounds call kilotopound and // pass the current object if(ch == 'y' || ch == 'Y') kilotopound(*this); } void load::output(){ cout<>< uid=""> cout<"nabbreviation: "=""><> cout<"nuldid: "=""><> cout<"naircraft: "=""><> cout<"nweight: "=""><> cout<"ndestination: "=""><> } void kilotopound(load &l){ l.weight = l.weight * 2.2; } bool operator==(load& obj1,load& obj2){ //Two objects are equal if their abbreviation and uldid are equal if((obj1.abbreviation.compare(obj2.abbreviation) == 0) && (obj1.uldid.compare(obj2.uldid) == 0)) //If equal returns true return true; //else returns false return false; }     May 13 2022 07:29 PM

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
Open chat
1
You can contact our live agent via WhatsApp! Via + 1 (409) 205-8984

Feel free to ask questions, clarifications, or discounts available when placing an order.

Order your essay today and save 30% with the discount code DISCOUNT