Question: Java use the following code then have it print out The pool is width wide and depth deep and as order its a shape. Have

Java use the following code then have it print out

"The pool is width wide and depth deep and as order its a shape."

Have this repeat for each pool

import java.util.*; class InputWithArrayList { public static void main(String[] args) { Scanner sc=new Scanner(System.in); ArrayList pool=new ArrayList(); int count=1; int j=1; System.out.print("Enter Width : "); String width=sc.nextLine(); System.out.print("Enter Depth : "); String depth=sc.nextLine(); System.out.print("Enter Shape : "); String shape=sc.nextLine(); int w=Integer.parseInt(width); int d=Integer.parseInt(depth); while(true) { if(w==-1 || d==-1) break; pool.add(width); pool.add(depth); pool.add(shape); System.out.print("Enter Width : "); width=sc.nextLine(); w=Integer.parseInt(width); if(w==-1) break; System.out.print("Enter Depth : "); depth=sc.nextLine(); d=Integer.parseInt(depth); if(d==-1) break; System.out.print("Enter Shape : "); shape=sc.nextLine(); }

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!