An angle may be measured in degrees and minutes.
Eg: ∠a=70 degrees 35 mins, ∠b=50 degrees 40 mins
sum of angles c is ∠c=∠a + ∠b = 121 degrees 15 mins (Since 1 degree = 60 mins)
Create a class called 'angle' with the following details
instance variables
int deg, int min - to store degrees and minutes of an angle
methods
void enterangles() -to input an angle
angle sumangle(angle a,angle b) -to find sum of the angles and display it.
void display() - to display the degrees and minutes of an angle
WAP using the above class to accept 2 angles and find their sum and display it.
Answers
Answered by
0
Answer:
: ∠a=70 degrees 35 mins, ∠b=50 degrees 40 mins
sum of angles c is ∠c=∠a + ∠b = 121 degrees 15 mins (Since 1 degree = 60 mins)
Create a class called 'angle' with the following details
instance variables
int deg, int min - to store degrees and minutes of an angle
methods
void enterangles() -to input an angle
angle sumangle(angle a,angle b) -to find sum of the angles and display it.
void display() - to display the degrees and minutes of an angle
WAP using the above class to accept 2 angles and find their sum and display it.
Similar questions