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
In this project, you will write a software for the Registrar's office of a university called YouOIT to maintain information about students and courses at the university. The reg

What if one can''t wrap the local in an artificial block?

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b.   #include float start_poin

C Program to copy the contents of a file: void main()    {   ifstream fin("input.txt");   ofstream fout("output.txt");   char ch;   while (fin)       {

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


find the greater of the two variables, without using conditional loops or ternary operators?

Call by Reference Passing variables(parameters) to a function in C can be done in two ways - pass by value, also called as call by value and pass by address or also known as ca

The program reads two numbers and a character (operator). If the character is "+" then sum is displayed. If it is "-"then difference is displayed. If it is "*" then product is disp

Pure Virtual Functions An abstract class is one, which is used just for deriving some other classes. No object of this class is declared and used in the program. Likewise, ther