Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

Evaluating Group Performance?

Answered: 1 week ago