stu nicholls dot com | menu - Professional dropdown #3

#include  < iostream.h >
#include < conio.h >
class item
{
private:
int number;
float cost;
public:
void getdata(int a,float b);
void putdata(void);
};
void main()
{
clrscr();
item x,y,z;
x.getdata(100,25.5);
x.putdata();
getch();
}
void item::getdata(int a,float b)
{
number=a;
cost=b;
}
void item::putdata(void)
{
cout << "number=" << number;
cou << "\n cost=" << cost;
}
GO BAck
Footer1