Program is to find the area of room, C/C++ Programming

Program is to find the area of room:

Program is to find the area of room with default values using classes & object

class room

  {

  private:

    int len;

    int wid;

    int hei;

  public:

       int ar;

  // function definitions

     void assign()

       {

      len=20;

      wid=30;

      hei=40;

       }

    void area()

     {

    ar=2*(len*wid+wid*hei+hei*len);

     }

 

    void disp()

       {

    cout<<" length "<

    cout<<" breadth "<

    cout<<" height "<

    cout<<" area "<

       }

  };

 

 void main()

   {

   clrscr();

   room area1;

   area1.assign();

   area1.area();

   area1.disp();

   }

Posted Date: 10/19/2012 5:29:20 AM | Location : United States







Related Discussions:- Program is to find the area of room, Assignment Help, Ask Question on Program is to find the area of room, Get Answer, Expert's Help, Program is to find the area of room Discussions

Write discussion on Program is to find the area of room
Your posts are moderated
Related Questions
find largest clique present in graph

what is the diffeerence between c and c++

How can I handle a constructor that fails?

Differentiate between functions getch () and getche (). - Both functions accept a character input value from user. - When getch () is used, key that was pressed won't appear

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send

Define register with bit fields? We could define register simply with bit fields: struct DISK_REGISTER { unsigned ready:1; unsigned error_occured:1; unsigned disk_spinni

Op e r a t o r P r e c e d e n c e a n d A s s o c i a t i v e l y : T h e op e r a t o r p r e c e d e n c e a n d i

Talking to IO boards inside a computer or microcontroller depends upon the principles used by the microprocessor to address physical devices. On Motorola systems all devices connec

A palindrome is a string that reads the same from the both the ends. Given a string S convert it to a palindrome by doing character replacement. Your takes is to convert S to palin

Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new technology, they are send