Answer to Question #312679 in C++ for zoha

Question #312679

Write a program to create a class which name is rectangle and also creat two data members Wich data type is float and calculate area of triangle which formula is(area=1/2 *base*height)

1
Expert's answer
2022-03-16T10:23:06-0400

Here is program:

class rectangle
{
public:
	rectangle(int base, int height, float area)
	{
		area = 1 / 2 * base * height;
	}
private:
	int base;
	int height;
	float area;
};

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment