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
Study the given hierarchical class diagram and additional information, and answer the questions that follow: Sale Company: string unitPrice: double

Q. Explain that how do we implement two stacks in one array A[1..n] in such a way that neither the stack overflows unless the total number of elements in both stacks together is n.

flow chart for prime or not

Program to draw a circle: int main(void) {    /* request auto detection */    int gdriver = DETECT, gmode, errorcode;    int midx, midy;    int radius = 100;

flowcharting of 3 quizes display the average

Aim: To implement a program for dynamic data structure(linked list). Code:                       class node {             int data;             node *next;

Assignment:  write a C program and a MASM procedure.  The C program calls the MASM procedure to perform letter case conversion. Text sections covered:  12.1 to 12.3.1 Write a

I have a program and I want someone to fix it for me by using basic c language program.


Illustrate the Function Definition? The C code that explains what a function does is called the function definition. A function definition has the following form Type fun