input.txt output.txt
Create and complete the following 3 classes inside your P9 project:
private Rectangle [] rArray; private Triangle [] tArray; private Circle [] cArray;Copy the following getter methods into your class for testing purposes:
public Rectangle[] getRectangles(){ return rArray; } public Triangle[] getTriangles(){ return tArray; } public Circle[] getCircles(){ return cArray; }Create two methods with the following signatures:
public void readFile( String inputFile ){ }Within the main method:
public void writeFile( String outputFile ){ }
System.out.println(Arrays.toString(r9.rArray)); System.out.println(Arrays.toString(r9.cArray)); System.out.println(Arrays.toString(r9.tArray));This should print out the contents of each of your arrays.
1: Rectangle, (Width: 4.00, Length: 2.20), Area: 8.80 2: Circle, (Radius: 8.60), Area: 232.35 3: Circle, (Radius: 7.90), Area: 196.07 4: Circle, (Radius: 2.10), Area: 13.85 5: Circle, (Radius: 6.18), Area: 119.98 6: Triangle, (Height: 5.00, Base: 6.00), Area: 15.00 7: Triangle, (Height: 3.30, Base: 8.20), Area: 13.53 8: Triangle, (Height: 5.50, Base: 10.10), Area: 27.78