Java Programs isc icse bluej questions for practice


by STJOHNS SCHOOL, on 19/01/2010 at 14:26
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().
Search results for "Java Programs isc icse bluej questions for practice"
0 Replies
class Str { public static void main(String args[]) { String a[]=new String[1]; System.out.println(a[0]); } } ====================================================== remember the output of this program is:- null if u run this prg in bluej
Write a program in bluej to check a number is palindrome or not.??
hey! i need bluej programs based on strings (only question)
This topic belongs to the forum