Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int[] get_av_students() {
- int av_students[] = new int[9];
- for(int i = 0; i < 9; i++)
- {
- int hour = (10 + i)%12;
- if ( hour == 0 ) {
- hour = 12;
- }
- while (true){
- try{
- av_students[i] = Integer.parseInt(JOptionPane.showInputDialog(null, "Average Students "+hour+":00"));
- if (av_students[i] < 0) {
- JOptionPane.showMessageDialog(null,"No Negative Entries");
- continue;
- }
- }
- catch (IllegalArgumentException e) {
- JOptionPane.showMessageDialog(null,"Entries Must Be Numbers");
- continue;
- }
- break;
- }
- av_students[i] = Integer.parseInt(JOptionPane.showInputDialog(null, "Average Students "+hour+":00"));
- }catch (IllegalArgumentException ex) {
- JOptionPane.showMessageDialog(null, " NO NEGETIVES ALLOWED ");
- }
- return av_students;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement