Question: hello ive done this source code. but, the input that i can insert is just for 1 words. for an example the book title is

hello ive done this source code. but, the input that i can insert is just for 1 words. for an example the book title is 'the meg' but i just can put 'the' only and not in the full sentences. also same with the publisher and author name. should i do. please help me :'(

#include #include

using namespace std; class books

{ public: char *publisher; char *author; char *bookname; float bookprice; int copies; books(){ bookname=new char[50]; author=new char[50]; publisher=new char[50]; copies=0; 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<<" "<

int main(){ books b[100]; char *nmbook,*auth; nmbook = new char[50]; auth = new char[50]; 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 available books as follows "; cout<<"\t TITLE | AUTHOR | PUBLISHER | COPIES | PRICE | "; for (i=0;i>nmbook; cout<<"\tAUTHOR : "; cin>>auth; for (i=0;i>cpy; if (b[i].copies>=cpy){ total=cpy*b[i].bookprice; cout<<"\tEntered number of copies are available to us "; cout<<"\tTotal price of book "<

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!