Greetings everybody....
Am an beginner in c++.am doing my mini project in c++.
My mini project is SIMPLE BOOKSHOP CODING.
I have done my own coding but while compiling the program the compiler throws two errors on 33rd line.Can anybody solve this error and kindly reply me with the correct program.Also with the reason for the error.Thanking you in advance...:-)
Here is my program: #include<iostream.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
int n,cost,price=500;
char str[50];
char *bname[10]={"PARADISE",
"TARZAN",
"KING KONG",
"BATMAN BEGINS",
"THE DARK KNIGHT",
"CHARLIE CHAPLIN",
"THE DICTATOR",
"OOPS",
"C++",
"JAVA"};
class bs
{
public:
void getdata();
void avail();
void display();
};
void bs::getdata()
{
cout<<"\nEnter The Name Of The Book You Needed In BLOCKLETTERS:";
cin>>str;
}
void bs::avail()
{
for(int i=0;i<9;i++)
{
if(!strcmp(str,*bname[i]))
{
cout<<"\nBook Is Available";
display();
break;
}
}
if(i==9)
cout<<"\nBook Not Available";
}
void bs::display()
{
cout<<"\n Price Of The Book Is:Rs.500";
cout<<"\nEnter The No. Of Books:";
cin>>n;
cout<<"\n"<<n<<"No. Of Books Available";
cost=n*price;
cout<<"\nTotal Cost:"<<cost;
cout<<"\nPlease Pay The Cash And Take Your Books:-)"<<"\nThank You Come Again";
}
int main()
{
bs b;
int m;
clrscr();
cout<<"\nWelcome To NEW WORLD Bookshop:";
b.getdata();
b.avail();
b.display();
cout<<"\nDo You Wish To Continue:\n1.Yes \2.No";
cin>>m;
if(m==1)
{
b.getdata();
b.avail();
b.display();
}
else
{
cout<<"\nThank You!!!:-)";
}
return 0;
}