Object Oriented Concepts and Programming

Blog is for Object oriented concepts and prgramming. Specially for MCA GTU (Gujarat Technological University) student

RSS
  • Home
  • Edit

Example of Class

Wednesday, March 31, 2010 by Dr. Parag Shukla | 0 comments
/*1. Definition :

Create a class Item that has I_no, I_name
I_cost as data member and void getitem(void) & void putitem(void) as member functions.

*/

#include "iostream"
using namespace std;
class item
{
    private:
            int I_no,I_cost;
            char I_name[20];
    public:
            void getitem();
            void putitem();
};
void item :: getitem()
{
            cout<<"Enter The Item No...."; cin>>I_no;
            cout<<"Enter The Item Cost...."; cin>>I_cost;
            cout<<"Enter The Item Name...."; cin>>I_name;
}

void item :: putitem()
{
            cout<<"The Item No Is....";
            cout<<"The Item Cost Is....";
            cout<<"The Item Name Is....";
}

int main()
{

            system("cls");
            item i;
            i.getitem();
            i.putitem();
            system("pause");
}

Class, Item

Subscribe to: Posts (Atom)

Blog Archive

  • ▼  2010 (10)
    • ►  November (1)
    • ►  August (3)
    • ►  May (2)
    • ►  April (3)
    • ▼  March (1)
      • Example of Class

Followers

Labels

  • Argument (1)
  • Class (1)
  • Defualt Argument (1)
  • Fact (1)
  • Factorial (1)
  • Item (1)
  • OOCP Material (1)
  • Pass by address (1)
  • Pass By argument (1)
  • Recursive Function (1)

Contributors

  • Dr. Parag Shukla
  • Vishal Joshipura
  • vaibhav

Pages

  • Home
Copyright © 2010 Object Oriented Concepts and Programming