A C++ program to create a Room class that an architect might use to represent dimensions of the room. Include three data members of type int to represent the length, float to represent the width of room and double to represent the area of the room. Provide member function named as ‘SetDim’ takes the length and width of the Room as parameters and the other member function named as ‘CalArea’ returns area of the Room. Length and width are entered by the user. b. As the class has the following variable definitions: int length; float width; double area; and the following statement: area = length * width; o Which automatic data type conversion will take place?

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.1: Classes
Problem 8E
icon
Related questions
Question

A C++ program to create a Room class that an architect might use to represent dimensions of the room.
Include three data members of type int to represent the length, float to represent the width
of room and double to represent the area of the room. Provide member function named as
‘SetDim’ takes the length and width of the Room as parameters and the other member
function named as ‘CalArea’ returns area of the Room. Length and width are entered by
the user.
b. As the class has the following variable definitions:

int length;
float width;
double area;
and the following statement:
area = length * width;
o Which automatic data type conversion will take place?

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,