Problem:
Translate this ADT into a Java interface:
ADT: Circle
area(): Real
center(): Point
circumference(): Real
contains(Point): Boolean
equals(Circle): Boolean
radius(): Real
toString(): String
ADT: Circle
area(): Real
center(): Point
circumference(): Real
contains(Point): Boolean
equals(Circle): Boolean
radius(): Real
toString(): String
Output:
None
Solution:
public interface Circle { public double area(); public Point center(); public double circumference(); public boolean contains(Point point); public boolean equals(Object object); public double radius(); public String toString(); }
No comments :
Post a Comment