Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java

Timothy Van Cauwenberge
Timothy Van Cauwenberge
8,958 Points

Oyster Bar program help

Hi, I have to create the program that reads the size of a group that enters a leaves an oyster bar, and the maximum for the bar is 100 people. If the program reaches the max the program should quit. It recommends to use negative numbers for when groups leave. I am completely lost on this please help

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

Timothy. I am not very fluent in Java so I am not sure what would be the best way to solve your problem. Hope you find the answer to your question!

1 Answer

james south
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
james south
Front End Web Development Techdegree Graduate 33,258 Points

i don't know how the crowds are being input but a while loop might be appropriate, while occupancy <=100... add subtract add subtract add to occupancy, if it goes over 100 the loop will exit.