我是一名基础编程学生,我需要有关如何制作特定程序的帮助。场景是:人们进出事件,我需要跟踪他们。允许的人数限制为100人。人们可以单独或集体来。随着人们进出,总数应该会发生变化。达到限制后应拒绝人们访问。
一切都将进入 JOptionPane。
不确定我是否正在寻找最好的网站寻求帮助,但任何建议都会有所帮助。
我知道我会为此做一个while循环。
import javax.swing.JOptionPane;
public class HwTwoPt2 {
public static void main(String[] args) {
int enter, exit, total;
int maxCapacity = 106;
int count = 0;
int groupAmt = 0;
while(count != maxCapacity){
groupAmt = Integer.parseInt(JOptionPane.showInputDialog("Enter total amount in the group: "));
}
}
}