You have the Artifact and the Circle classes. Write a method that will print the origin and price of the largest circle among all the circle objects of an array provided through the parameter of the method. Further explanation: The method header is provided below. circles is the reference to the array that holds all the Circle objects. Your task is to write code to print the origin and price of the largest Circle object. Assume that there is only one "largest" Circle object. public static void printLargestCircle(Circle[] circles){ class Artifact{
private double price;
String origin;
double getPrice(){
return price;
}
void setPrice(double p){
price = p;
}
} //artifact
class Circle extends Artifact{
private double radious = 0.5;
Circle(double rad){
radious = rad;
}
public double getRadious(){
return radious;
}
public double getArea(){
double area = Math.PI * radious * radious;
return area;
}
}// circle

Solved
Show answers

Ask an AI advisor a question