Computer Science, asked by julia19, 3 months ago

Define a class Triangle with the following specifications :
Instance variables:-
int a, int b ,int c ,int sum : Stores the three angles of a triangle.
Member functions:-
Triangle() : initializes data members to default values.
void accept() : accepts the angles for the triangle from user.
void typetri() : Calculates the sum of all 3 angles and prints the type of
Triangle based on the given criteria.
Criteria Type of Triangle
All angles less than 90o Acute Triangle
Any one angle is 90o Right angle Triangle
Any one angle above 90o Obtuse Triangle
void display() : Prints the 3 angles, sum of all angles and type of Triangle
Write the main() , create object and invoke the methods.​

Answers

Answered by Luckydancer950
1

Answer:

Constructor is used to initialize the data members of a class. ... What are the temporary instances of a class? ... class Right_Triangle { int p; int b; public Right_Triangle(int x, int y) { p = x;

Similar questions