Write a program to help a local bookshop automate its billing system. The program should do the following:
(a)Let the user enter the ISBN, the system will trace the title and price of the book automatically. The system should check whether the book is in the stock or not. If it is not, please let the user to enter again.
(b)Allow a customer to buy more than one item from the bookshop.
(c)Calculate and print the bill. The billing amount should include 5% tax.
Sample Output:
Welcome to Billy’BookShop
Please enter the ISBN: 0128
The title is C++ How to Program
The Price is RM 108.90
Do you wish to continue? y/n
y
Please enter the ISBN: 0992
The title is Introduction to Java Programming
The Price is RM 89.60
Hi,
We can't program all your c++ utility, but we can probably help you solving problems encountered during the programming of your program...
So, what problems do you have while programming your utility?
Alp
__________________________
Be C++ Mon Blog (C++, Intelligence Artificielle, Prolog)
Hi,
we are not here to solve your homework, you have to do it from yourself if you want to learn something from it... The only thing that we can do is to help you if you have some problems to program this utility.
In which language do you program it ? C or C++ ?
If you use the C i would advice you to use some structures to order your code, you should do a struct for the books, which contains the informations like the price and then you just have to program some function to calculate the bill, etc.
If you do it with C++ you should use some classes, for the books because it is very helpful, you can have some functions for every book that is bought :)
Good Luck to program it and ask if you have some problems :)
Peace
__________________________
Grégory S.
eVias Web & Software Solutions.
Développement Web et logiciel en tout genre et Open Source.
raish
Hi, sorry but this is a french programming forum, so only a few people might help you. And my english is to bad to help you. Bye. PS: me suis dépassé, y'a au moins quatre fautes! C'est mieux qu'avant je trouve!
reply: i know is france..i just droping by see who know to solve the problems here...ur gnlish not bad wat..the way i see u wrote the english...
RAish...can help me solve the problem using C++??
struct bookshop
{
int ISDN;
char title;
int price;
}book[];
void printbook (bookshop book);
int main()
{
float amount, rate;
int year;
cout <<"Please enter the amount: ";
cin >> amount;
cout <<"Please enter the number of years to invest: ";
cin >> year;
cout <<"Please enter the interest rate per year: ";
cin >> rate;
for (int y=0;y<year;y++)
amount = amount + (amount*rate/100);
cout <<"The amount you have "<<year<< "year is:"
<< amount<<endl;
1. Let the user enter the ISBN, the system will trace the title and price of the book automatically. The system should check whether the book is in the stock or not. If it is not, please let the user to enter again.
2. Allow a customer to buy more than one item from the bookshop.
3. Calculate and print the bill. The billing amount should include 5% tax.
Sample Output:
Welcome to Billy’BookShop
Please enter the ISBN: 0128
The title is C++ How to Program
The Price is RM 108.90
Do you wish to continue? y/n
y
Please enter the ISBN: 0992
The title is Introduction to Java Programming
The Price is RM 89.60
int main()
{
double ISDN ;
char title;
float price;
cout<<"---Welcome To Billy's Bookshop---\n";
cout<<"Please enter the ISDN: ";
cin>>ISDN;
if (ISDN==12)
{
cout<<"The Title is C++ How to Program"<<endl<<"The Price is RM 108.90"<<endl;
}
if (ISDN==98)
{
cout<<"The Title is Introduction to Java Programming"<<endl<<"The Price is RM 89.60"<<endl;
}
else
{
cout<<"Not Valid"<<endl;
}
return 0;
}