Question: Question 2: Read the code of the class rectangle and the main class, then answer the following questions. class Rectanglet int length, widthi Rectanglelint ,

 Question 2: Read the code of the class rectangle and the

Question 2: Read the code of the class rectangle and the main class, then answer the following questions. class Rectanglet int length, widthi Rectanglelint , int w)( leaath 1: width - w int calsulatexea ) f dat area-length * width; ystan outupriaslaW "Length: tiength ". Width: "+ width) a xiatlal"Area: Riblic static void main String 1 args) ( ArrayListsRectangles zeclist + hew Arraylist() zeciiatuada (new Rectang1e(3, zecilstladd (new Reckangl(4.5))/ CAsadd D/ new Rectangle(5,6)) xacistleetii/hew Rectangle (6. 7) MIS306 ArrayList Assignment Spring 2018 b. Rewrite the main class to do the following: 1. Create a new list of rectangles, and fill in the array list from a text file containing values for 10 or more different rectangles. 2. Write java statement to insert another new rectangle (4x6) to index 0. 3. Replace the rectangle at index 1 by a new rectangle (5X5). 4. Replace the last rectangle on the list by a new rectangle (7X7). 5. Write a loop to print out the details of all rectangles in the list starting from the beeinning of the list until the end of the list

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!