Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me. i dont know why my source code is error #include #include using namespace std; class books { public: char publisher; char author;

please help me. i dont know why my source code is error

#include #include

using namespace std; class books

{ public: char publisher; char author; char bookname; float bookprice; int copies; books(){ char *bookname=new char; char *author=new char; char *publisher=new char; int copies=0; float bookprice=0.0; } void accept(); void display(); };

void books::accept() { cout<<"BOOK TITLE : "; cin>>bookname; cout<<"AUTHOR : "; cin>>author; cout<<"PUBLISHER OF BOOK : "; cin>>publisher; cout<<"NUMBER OF COPIES AVAILABLE : "; cin>>copies; cout<<"PRICE : "; cin>>bookprice; }

void books::display(){ cout<<"/n"<

int main(){ books b; char nmbook,auth; int i,count=0,choice,ch,cpy,flag=0; float total; cout<<"============================================================="<>choice; switch (choice) { case 1 : cout<<"please enter BOOK DETAILS as below : "; b[count].accept(); count++; break; case 2 : cout<<"/t/t/t/t available books as follows "; cout<<"/t/t/t/t TITLE | AUTHOR | PUBLISHER | COPIES | PRICE | /n"; for (i=0;i>nmbook; cout<<"/t/t/t/t AUTHOR : "; cin>>auth; for (i=0;i>cpy; if (b[i].copies>=cpy){ total=cpy*b[i].bookprice; cout<<"\t\t\t\t Entered number of copies are available to us"; cout<<"\t\t\t\t Total price of book "<

} } if (flag==0) { cout<<" \t\t Entered number of copies are not available to us"; } break; case 4:return 1; break; } } while (ch!=4); return 0; }

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

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

i need correct answrrs 9 5 2

Answered: 1 week ago