Answer to Question #312756 in C++ for zoha

Question #312756

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) uses constructor

1
Expert's answer
2022-03-16T18:31:36-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