Advertisement
kalin729

info_Prog

Apr 19th, 2022 (edited)
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 KB | None | 0 0
  1. public static void info_Prog(Teacher teach[]) {
  2.         System.out.println("Programirane teachers: ");
  3.         boolean foundTeacher = false;
  4.         for (int i = 0; i < teach.length; i++) {
  5.             if (teach[i].getSubject().equals("Programirane")) {
  6.                 System.out.println((i + 1) + ". " + teach[i].getName());
  7.                 foundTeacher = true;
  8.             }
  9.         }
  10.         if (!foundTeacher) {
  11.             System.out.println("No teachers found.");
  12.         }
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement