Results 1 to 2 of 2
- 11-01-2011, 01:29 PM #1
Member
- Join Date
- Oct 2011
- Posts
- 11
- Rep Power
- 0
this java programme has compiled but does it answer the qn
efine a Java class called Circle with data fields for centre coordinate values , circle radius and circle area, where the area is given by Math.PI*radius*radius. The class also has a Circle constructor with arguments for the centre coordinate ( x,y) and radius. The class also has a public method for getting circle area. [8 marks
class Circle{
double x;
double y;
double radius;
double area ;
Circle(double a,double b,double c){
x = a;
y = b;
radius = c;
}
public double getArea(double d){
return Math.PI*radius*radius;
}
}
- 11-01-2011, 01:42 PM #2
Re: this java programme has compiled but does it answer the qn
You never use the global area variable. And why does your getArea() function take a parameter that you never use?
How to Ask Questions the Smart Way
Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!
Similar Threads
-
How to run java programme automatically daily at 3PM
By trkece in forum New To JavaReplies: 3Last Post: 06-22-2011, 08:12 AM -
Compare true Answer /Player answer
By Eilime in forum New To JavaReplies: 1Last Post: 04-24-2011, 08:51 PM -
According to java why can not this program be compiled?
By Varuna in forum New To JavaReplies: 3Last Post: 12-12-2008, 02:44 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks