Answer to Question #321344 in C++ for yormi

Question #321344

1.Find the error(s) and show how to correct it(them) in each of the following.a.Filepets.datthat stores its id, name, age and ownerof the pet is referred to by ofstream objectpetfile.petfile>>pet_id>>pet_name>>pet_age>>pet_owner;b.The following statement should create an ifstream objectsalesfilethat refers to the fileweeklysales.datthat contains data about the id thesalesperson, total sales generated, and theweek number, read the data from the file and display it on the console output.ifstream salesfile(“weeklysales.dat”);int id,wk;float sales;salesfile>>id>>wk>>sales;while (!salesfile.eof()){cout<<id<<”\t”<<sales<<”\t”<<wk<<”\n”;salesfile<<id<<wk<<sales;}c.The salaries.dat should be updated to include the salary details of new employees. An ofstreamobject is created to refer to the file so new data can be added at the end of the file.ofstream salfile;salfile.open(“salaries.dat”,ios::out);

0
Service report
It's been a while since this question is posted here. Still, the answer hasn't been got. Consider converting this question to a fully qualified assignment, and we will try to assist. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog