#include<iostream.h>

#include<conio.h>

Class product

{

int qty;

float cost;

public:

void getdata ( int a, float b);

void putdata(void)

};

void product::getdata(int a, float b)

{

qty=a;

cost=b;

}

void product:: putdata(void)

{

cout<<“Quantity=”<<qty;

cout<<“Cost=”<<cost;

}

void main()

{

product P;

cout<<“the object P is”<<endl;

P.getdata(45,5469.25);

P.putdata();

getch();

}

Advertisements