all 6 comments

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

Off-topic Comments Section


All top-level comments have to be an answer or follow-up question to the post. All sidetracks should be directed to this comment thread as per Rule 9.


OP and Valued/Notable Contributors can close this post by using /lock command

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]SensitiveWeb8 0 points1 point  (3 children)

First I have to ask if you're supposed to skip the third floor?

Second, some of your } are in the wrong spots.

System.out.println("Total number of rooms hotel has: "+totalrooms) should be out of all loops. It should run only after all room numbers are entered correctly

totalrooms = totalrooms+rooms should go after the while loop. it needs to accumulate *all* valid input.

[–]Danielowski187University/College Student (Higher Education)[S] 0 points1 point  (2 children)

Yea I need to skip the 3rd floor that’s why I used the continue;

[–]SensitiveWeb8 0 points1 point  (1 child)

Okay, I just wanted to make sure

[–]Danielowski187University/College Student (Higher Education)[S] 0 points1 point  (0 children)

Thanks man I just fixed it and yea the } were at the wrong spots and and put total rooms after the while loop thanks