Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please very importantly ? Write Program in C++ And read the file txt life_of_pie 2.5 20 Estrdad_Omar 3.70 15 Sajeen_Almaraya 3.65 20 Central_Park 4.0 10

please very importantly ? Write Program in C++ And read the file txt

life_of_pie 2.5 20 Estrdad_Omar 3.70 15 Sajeen_Almaraya 3.65 20 Central_Park 4.0 10 Ana_Yousof 4.55 17 Shefra_Bilal 5.00 30 Crhismas 5.30 50 Harry_Potter 6.5 25 Da_Vinci_Code 6.0 6 Angels&Demons 3.40 5

image text in transcribed

you can continue this code i need no errors and continue this code

#include

#include

using namespace std;

int index=0;

void load_file(string tit[],double pri[],int qua[]);//prototype

int Max_Price(double pri[]); //max price array return index;

int search_book(string title[],string booktitle);//loop 0--index (if found return index else -1)

void remove_book(string tit[],double pri[],int qua[]);//search quantity book quan=0

//remove

//for (0-count)search book quantity ==0 {loop index -count shiffting array} index--

void sell_book(string title[],int qua[],string bookname)

{

int loc=search_book(title,bookname);

if(loc !=-1)//found

{

qua[loc]--;

}

}

int main()

{

string titles[100];

double prices[100];

int quantity[100];

load_file(titles,prices,quantity);//function call

for(int i=0;i

cout

// cout

return 0;

}

void load_file(string tit[],double pri[],int qua[])

{

ifstream lib;

lib.open("info.txt"); //lib --> info.txt

//lib.eof() return 1 end of file else 0

while( (! lib.eof()) && index

lib>>tit[index]>>pri[index]>>qua[index]; //read file

index++;

}

}

Problem 1: 1) Follow your instructor directions to create a new project in code blocks. Type the following code to your .cpp file. #include using namespace std; int main() cout

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago