STJOHNS SCHOOL
| Subject: Java Programs isc icse bluej questions for practice Tue Jan 19, 2010 8:26 pm | |
| Q2. An angle may be measured in degrees and minutes. E.g.
A= 70 degrees 35 minutes and B = 50 degrees 40 minutes Now to find the sum of these two angles:
C = A + B
= 70 degrees 35 minutes + 50 degrees 40 minutes
= 121 degrees 15 minutes (Since 1 degree = 60 minutes)
Define a class angle for accepting and calculating the sum of the two angles given. The description of the class is given as follows:
Class name angle Data members: int deg,min Member functions:
angle() constructor void accept() for accepting the angles angle sumangle(angle, angle) for calculating the sum of the two
angles given and return the sum.
void display() to print sum of angles
Write a program to specify the class angle with all member function and main(). |
|
themeghdeepmb7
| Subject: Re: Java Programs isc icse bluej questions for practice Mon Jul 09, 2012 11:04 pm | |
| - STJOHNS SCHOOL wrote:
- Q2.
An angle may be measured in degrees and minutes. E.g.
A= 70 degrees 35 minutes and B = 50 degrees 40 minutes Now to find the sum of these two angles:
C = A + B
= 70 degrees 35 minutes + 50 degrees 40 minutes
= 121 degrees 15 minutes (Since 1 degree = 60 minutes)
Define a class angle for accepting and calculating the sum of the two angles given. The description of the class is given as follows:
Class name angle Data members: int deg,min Member functions:
angle() constructor void accept() for accepting the angles angle sumangle(angle, angle) for calculating the sum of the two
angles given and return the sum.
void display() to print sum of angles
Write a program to specify the class angle with all member function and main(). |
|