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

How can I handle a destructor that fails? Need help please provide example also.

Need help with C network program

Question 1 . Write a brief note on Aggregation Question 2 . Discuss briefly on constructors Question 3 . What are the important advantages of Inheritance? Question 4 .

A: 1.      By using const protects you against programming errors which inadvertently alter data. 2.      By using const allows function to procedure const and non-const actu

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 that reads a line of characters from the user and displays that entire line after converting any uppercase characters to lowercase also change any lowercase charact

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

Friend function in c++: class miles; class km  {    float value;    public :   // void input();     km convert(km  ,int a ) ;    void output()    {