Reading Material Purchasing System
------------------------------------------
the program have a book sales
User will select the type of book they want to buy such as Fiction,
non-Fiction
Fiction Non-Fiction
------- -------------
////////....$ /////////////.......$
///////......$ ///////////////....$
///////.....$ //////////....$
at the end (print out)
list down the book they buy
Total of all the book with it price
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
#include <iostream.h>
class Purchase{
private:
int type;
int sum;
char name[][50];
char choose[][50];
public:
Purchase(int =0);
~Purchase(){}
void setData(int =0);
void select();
void calculate();
void print();
};
Purchase::Purchase(int t)
{
type=t;
sum=0;
char name[20][50]={ "A Begineer's Guide, McGraw-Hill/Osborne 2002", "RM57.60",
"Programming in C++, McGraw-Hill, 2003", "RM68.40",
"Schaum's Programming with C++, McGraw Hill, 2000", "RM64.80",
"C++ How to Program, Prentice Hall, 4th Edition (2003)","RM66.60",
"Logic and Computer Design Fundamental, Mano,2000", "RM70.40",
"Computer System Architecture, Hamacher,2002", "RM66.60",
"Understanding Operating System ,Ida M Flynn,2001", "RM46.80",
"Pengenalan Kepada Sistem Komputer,Mc-Graw-Hill,2002", "RM12.60",
"Titas1,Penerbit UM,K.L.2001", "RM32.50"
"Human right and new world order, Penang 1993", "RM45.00"}
}
void Purchase::setData(int t)
{
type=t;
sum=0;
char name[20][50]={ "A Begineer's Guide, McGraw-Hill/Osborne 2002", "RM57.60",
"Programming in C++, McGraw-Hill, 2003", "RM68.40",
"Schaum's Programming with C++, McGraw Hill, 2000", "RM64.80",
"C++ How to Program, Prentice Hall, 4th Edition (2003)","RM66.60",
"Logic and Computer Design Fundamental, Mano,2000", "RM70.40",
"Computer System Architecture, Hamacher,2002", "RM66.60",
"Understanding Operating System ,Ida M Flynn,2001", "RM46.80",
"Pengenalan Kepada Sistem Komputer,Mc-Graw-Hill,2002", "RM12.60",
"Titas1,Penerbit UM,K.L.2001", "RM32.50"
"Human right and new world order, Penang 1993", "RM45.00"}
}
void Purchase::select()
{
if(type==1)
{
cout<<"Select the book(s):\n"
<<"\t1.A Begineer's Guide, McGraw-Hill/Osborne 2002\tRM57.60\n"
<<"\t2.Programming in C++, McGraw-Hill, 2003\tRM68.40\n"
<<"\t3.Schaum's Programming with C++, McGraw Hill, 2000\tRM64.80\n"
<<"\t4.C++ How to Program, Prentice Hall, 4th Edition (2003)\tRM66.60\n";
cin>>p;
!strcmp(
}
else if(type==2)
{
cout<<"Select the book(s):\n"
<<"\t1.Logic and Computer Design Fundamental, Mano,2000\tRM70.40\n"
<<"\t2.Computer System Architecture, Hamacher,2002\tRM66.60\n";
cin>>s;
}
else if(type==3)
{
cout<<"Select the book(s):\n"
<<"1.Understanding Operating System ,Ida M Flynn,2001\tRM46.80\n"
<<"2.Pengenalan Kepada Sistem Komputer,Mc-Graw-Hill,2002\tRM12.60\n";
cin>>o;
}
else if(type==4)
{
cout<<"Select the book(s):\n"
<<"1.Titas1,Penerbit UM,K.L.2001\tRM32.50\n"
<<"2.Human right and new world order, Penang 1993\tRM45.00\n";
cin>>t;
}
}
void Purchase::calculate()
{
void main()
{
Purchase obj;
cout<<"Type of Book:\n"
<<"\t1.Programming\n"
<<"\t2.System & Architecture\n"
<<"\t3.Operating System\n"
<<"\t4.Other\n"
<<"\t5.Submit\n";
cin>>t;
obj.setData(t);
obj.select();
obj.calculate();
obj.print();
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
RM mean Malaysian Dollar
This program is still in process
I need Your help
Helppp........... :confused: