Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java How would I make it so it just prints out all the pools once the user stops imputing information import java.util.*; class InputWithArrayList {

Java How would I make it so it just prints out all the pools once the user stops imputing information 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; // print the data here System.out.println("The pool is "+width+" wide and "+depth+" deep and as order its a "+shape); 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

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

Readings In Database Systems

Authors: Michael Stonebraker

2nd Edition

0934613656, 9780934613651

More Books

Students also viewed these Databases questions