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
write a pseudo code for computing sin(x) using sentinel control loop

Comments Comments are integral part of every program . Comments help in coding, debugging and maintaining a program . The compiler ignores them. They should be used liberally i

write a programme that allows a user to enter 5 distinct words and returns them as a single string

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

write a program to find the area under the curve y=f(x) between x=a & x=b

I would like to get you to collaborate in my project. We want a C programmer to Develop applications for Windows, the first application may be an Instant messenger encrypted in a w

Can any constructor throw an exception? How to handle error while the constructor fails?

C program to demonstrate Pointer to string: void main() {                 int a;                 char str[]="hello how are you?",*ptr_str;                 ptr_str=&

Inline Functions Imagine a c program, which reads disk records having employee information. If this is a payroll application each employee record data is probably processed by

Explain about Evaluation of Expression in c language? An Expressions are evaluated using an assignment statement of the form: variable = expression; The Variable is any v