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
How is stl different from c++ standard library?
What are the components of stl?
what is template and type convertion
totoo po ba ang manga aliens!
What is meant by stl in c++?
In what scenario does the Logical file and Physical file being used?
Explain stl.
Q1. A. What is unary operator? List out the different operators involved in the unary operator. B. What is an adjust field format flag? Q2. A. Distinguish between a # include and #define. B. Can a list of string be stored within a two dimensional array? Q3. A.Explain how a pointer to function can be declared in C++? B.List the merits and demerits of declaring a nested class in C++? Q4. A. What are the syntactic rules to be avoid ambiguity in multiple inheritence? B. Explain the operation of overloading of an assignment operator. Q5. A. Explain how the virtual base class is different from the conventional base classes of the opps. B. Explain how an exception handler is defined and invoked in a Program. Q6. A. What is a binary file? List the merits and demerits of the binary file usagein C++. B. Write short notes on Text Manipulation Routines. C. Write bites in Turbo c++ Header (“Include”) Files.
What is stl in oop?
What are the different types of stl containers?
How connect plc and pc through software
How do I convert a stl file?
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
Is string part of stl?
When did c++ add stl?