write a c++ to define a class box with length,breadth and
height as data member and input value(),printvalue() and
volume() as member functions.
Answer Posted / manish bhambhu
#include<iostream>
using namespace std;
class cuboid
{
public:
float length;
float breadth;
float height;
};
int main()
{
cuboid Box1;
cuboid Box2;
float volume = 0.0;
Box1.height = 5.0;
Box1.length = 6.0;
Box1.breadth = 7.0;
Box2.height = 10.0;
Box2.length = 12.0;
Box2.breadth = 13.0;
volume=Box1.height*Box1.length*Box1.breadth;
cout<<"
Volume of Box1 : "<<volume<<endl;
volume=Box2.height*Box2.length*Box2.breadth;
cout<<"
Volume of Box2 : "<<volume<<endl;
return 0;
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
Is there any error below, its a code to delete all entires from a map #include
What are stl algorithms?
How connect plc and pc through software
how can u do connectivity in c++ language? plz send me connectivity code in c++ ?
what is template and type convertion
How stl is different from the c++ standard library?
write a program that will accept a number and print.its equivalent in words the maximum input number is 9999
Why should a c++ programmer be interested in stl?
Define stl.
Is stl open source?
how to making game in c++ ?
What does stl stand for in basketball?
What is stl language?
What is meant by stl in c++?
help me i need a c++ program which takes sequesnce of characters and outputed sequence of their token taypes, work same compiler in lexical analysis phase