import [Link].
Scanner;
import [Link];
class Main {
public static void main(String[] args) {
Scanner sc = new Scanner([Link]);
[Link]("----------------------------SCHOOL
PROGRAM----------------------------");
ArrayList<String> teach = new ArrayList<String>();
[Link]("Mr. Aizen");
[Link]("Mrs. Roberts");
[Link]("Ms. Davis");
[Link]("Dr. Clark");
ArrayList<String> students = new ArrayList<String>();
[Link]("John Doe");
[Link]("Jane Smith");
[Link]("Alice Johnson");
[Link]("Bob Brown");
String[] usernames = {"teacher", "student", "admin"};
String[] passwords = {"1234", "abcd", "admin"};
String[] subjects = {"Computer Programming", "Introduction to Computing",
"Physical Education", "Computer Programming 2"};
boolean continueProgram = true;
while (continueProgram) {
[Link]("[1] Login....");
[Link]("[2] Exit.....");
[Link]("Enter Number: ");
if (![Link]()) {
[Link]("Invalid input. Please enter a number.");
[Link]();
continue;
}
int choice = [Link]();
[Link]();
if (choice == 1) {
[Link]("---------------------------------------------------------------
");
[Link]("Enter Username: ");
String username = [Link]();
[Link]("Enter Password: ");
String password = [Link]();
boolean validLogin = false;
for (int i = 0; i < [Link]; i++) {
if (usernames[i].equals(username) &&
passwords[i].equals(password)) {
validLogin = true;
if (i == 0) {
[Link]("--------Welcome Teacher---------");
} else {
[Link]("--------Welcome Student---------");
}
break;
}
}
if (!validLogin) {
[Link]("Invalid username or password");
continue;
}
boolean menuActive = true;
while (menuActive) {
[Link]("--------[1] Teachers---------");
[Link]("--------[2] Students--------");
[Link]("--------[3] Subjects----------");
[Link]("--------[4] Tuition Fee--------------");
[Link]("--------[5] Exit--------------");
[Link]("Enter Number: ");
if (![Link]()) {
[Link]("Invalid input. Please enter a valid
number.");
[Link]();
continue;
}
int menuChoice = [Link]();
[Link]();
switch (menuChoice) {
case 1:
[Link]("----------------------------
TEACHERS----------------------------");
for (String teacher : teach) {
[Link](teacher);
}
[Link]("Do you want to add a new teacher?
[yes/no]");
String addTeacherChoice = [Link]();
if ([Link]("yes")) {
[Link]("Enter the new teacher's name: ");
String newTeacher = [Link]();
[Link](newTeacher);
[Link]("New teacher added
successfully!");
}
[Link]("---------------------------------------------------------------
");
break;
case 2:
[Link]("----------------------------
STUDENTS----------------------------");
for (String student : students) {
[Link](student);
}
[Link]("Do you want to add a new student?
[yes/no]");
String addStudentChoice = [Link]();
if ([Link]("yes")) {
[Link]("Enter the new student's name: ");
String newStudent = [Link]();
[Link](newStudent);
[Link]("New student added
successfully!");
}
[Link]("---------------------------------------------------------------
");
break;
case 3:
[Link]("----------------------------
SUBJECTS----------------------------");
for (String subject : subjects) {
[Link](subject);
}
[Link]("---------------------------------------------------");
break;
case 4:
[Link]("Tuition Fee feature coming
soon...");
break;
case 5:
[Link]("Exiting program...");
menuActive = false;
break;
default:
[Link]("Invalid choice");
break;
}
}
} else if (choice == 2) {
[Link]("Exiting program...");
continueProgram = false;
} else {
[Link]("Invalid choice. Please try again.");
}
}
}
}