Question: I need help making a program for my class. So far I have the start method. I need to have a create method:static method and

I need help making a program for my class. So far I have the start method. I need to have a create method:static method and a display method.

I need help making a program for my class. So far I

The create method: a static method

This method has a parameter a file name such as shape.txt, and returns an array list of shapes (rectangles, triangles, and circles). This method reads shape data from a file, and create shapes. The data set for each shape consists of the type of the shape, the name of the shape and sizes of the shape. When an invalid triangle is made (the second triangle stored in the file), the program should be terminated. You must add more data into this file to test more shapes.

The display method: a static method

This method should be designed with an ArrayList parameter, and displays each shape along with the area of each shape. An array list of shape can be passed into this method, and are printed.

Part V: Helper class: Create a helper class with three helper methods to test the design of shape package. start method: A static method This method is called in main in ShapeDriver. It calls method create that creates/returns a list of shapes. It also calls method display that displays the list of shapes in order. public static void start throws FileNotFoundException Scanner input-new Scanner (System.in) string fileName ArrayList shapes; System.out.println ("Enter a file name: " fileName = input.next(); shapes-create (fileName) // calls create that returns a list of shapes display (shapes II calls display to print the list of shapes in order input.close )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!