Question
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
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++; } }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started