Question: //PLEASE HELP ME MAKE MY PROGRAM READ THE LAST CODE(VOID AVAILABLE), ALSO CAN YOU FIX THE INFINITE LINE IN SOME OF THE CODES WHEN YOU

//PLEASE HELP ME MAKE MY PROGRAM READ THE LAST CODE(VOID AVAILABLE), ALSO CAN YOU FIX THE INFINITE LINE IN SOME OF THE CODES WHEN YOU PUT THE INFORMATION NEEDED?

//PLEASE HELP ME MAKE MY PROGRAM READ THE LAST CODE(VOID AVAILABLE), ALSO

//thanks in advance // the code

#include #include #include #include using namespace std;

struct devicedata { string device_name; float quantity; char price; int stock; string pname; };

int stock, price; string pname;

void add(); // add devices void show(); // show devices int remove(); // remove devices void purchase(); // purchase void available(); //available devices

int main() { int c; char pass[20]; mainmenu: cout>c; switch(c) { case 1: { A: cout>pass; if(strcmp(pass,"devices")==0) { system("cls"); goto managermenu; } else { cout>a; switch(a) { case 1: { add(); system("cls"); show(); getch(); system("cls"); goto managermenu; break; } case 2: { system("cls"); show(); getch(); goto managermenu; break; } case 3: { remove(); getch(); goto managermenu; break; } case 4: { system("cls"); goto mainmenu; } case 5: { exit(0); }

} customermenu: cout>d; switch(d) { case 1: { purchase(); goto customermenu; break; } case 2: { system("cls"); show(); getch(); system("cls"); goto customermenu; break; } case 3: { system("cls"); goto mainmenu; } case 4: { exit(0); } }

switch(b) { case 1: { available; goto customermenu; break; } case 2: { system("cls"); show(); getch(); system("cls"); goto customermenu; break; } case 3: { system("cls"); goto mainmenu; } case 4: { exit(0); } } getch(); return 0; }

void add() { cout>pname>>price>>stock; ofstream shop; shop.open("shop.txt" , ios::app); shop

void show() { cout>pname; show>>stock; show>>price; while(!show.eof()) { cout>pname; show>>stock; show>>price; } show.close(); }

int remove() { string b; cout>b; ifstream del; del.open("Devices.txt"); ofstream nfile; nfile.open("Devices.txt"); del>>pname; del>>stock; del>>price; if(b!=pname) { cout>pname; del>>stock; del>>price; } nfile.close(); del.close(); remove("shop.txt"); rename("temp.txt", "shop.txt"); }

void purchase() { string p; int quantity; cout>p; cout>quantity; ifstream buy; buy.open("Devices.txt", ios::app); ifstream tmp; tmp.open("temp.txt"); cout

void available() { for(int i = 0; i >electrical; cin>>electronic; cin.ignore(); } cout UJILLI L. (USCISTUSER\Desktop\c+ 3}} 333}}}}}} rr rr rr rr . rr rr rr rr rr JJ broject\2222222222222222222.exe CO OO OOO CO 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 9 6 6 6 6 6 6 6 Oo oo

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!