I am writing a problem that will determine how much paint a user needs to paint their house. The program will ask them "how many rooms are in your house?", and then ask, for example, "what are the dimensions of room 1", then "what are the dimensions of room 2" until it asks them "what are the dimensions of room 9" if they inputted, say, 9 rooms. How would I write a program to ask the user the dimensions of however many number of rooms they inputted?
Asked
Active
Viewed 51 times
1 Answers
0
You should fill this skeleton of algorithm :
int rooms = ...;
for (int i = 0; i < rooms; i++) {
//ask dimensions
}

Dici
- 25,226
- 7
- 41
- 82

ControlAltDel
- 33,923
- 10
- 53
- 80
-
I can see where this answer is headed, but it might be a bit premature to start answering it – Jason Sperske Sep 28 '14 at 22:36
-
I don't think I'm giving away that much here ;) – ControlAltDel Sep 28 '14 at 22:38
-
True, but I think @Michael needs to show a little more effort. Perhaps they are stuck at handling input or parsing it. – Jason Sperske Sep 28 '14 at 22:39
-
[Here](http://stackoverflow.com/questions/5287538/how-to-get-basic-user-input-for-java) is an answer that covers how to get user input, combined with @ControlAltDel's answer you would be 99% of the way there :) – Jason Sperske Sep 28 '14 at 22:45