C++ Question with uncomplete answer..anyone can solve it?
(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.
(2)Calculate and print the bill. The billing amount should include 5% tax.
Here The 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
Do you wish to continue? y/n
n
Your Receipt:
0128 RM 108.90
0992 RM 89.60
Total RM 198.50
Tax RM 9.92
Total RM 208.42
THANK YOU!!!
Code:
#include <iostream>
#include <fstream>
#include <iomanip>
using namespace std;
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;
}
Hope someone will complete the answer...see who got it?
:confused: :confused: :confused: :confused: :confused: