0% found this document useful (0 votes)
22 views

Project 1 New

The program implements a school management system with 6 classes using object-oriented principles like inheritance, association, and composition. The School, Student, and Teacher classes demonstrate inheritance. Classroom has an association with School. Subject and Exam have a composition relationship with Classroom and inherit its properties. The classes work together to model the entities and relationships in a school system.

Uploaded by

Talha Manzoor
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Project 1 New

The program implements a school management system with 6 classes using object-oriented principles like inheritance, association, and composition. The School, Student, and Teacher classes demonstrate inheritance. Classroom has an association with School. Subject and Exam have a composition relationship with Classroom and inherit its properties. The classes work together to model the entities and relationships in a school system.

Uploaded by

Talha Manzoor
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Project #1

Submitted By:

Name Talha Bin Manzoor


Name Hamza Aslam

Roll No Roll 2N4o:


Roll No 23

Submitted TO: Ma,am Anam Naseer


Course Title: Object oriented Programming
Department of CS&IT
University of the Poonch Rawalakot
School Management System
A school management system is a software application that helps educational institutions
manage their day-to-day administrative and academic activities. It automates and streamlines
processes such as admissions, fees management, staff management, curriculum and timetable
management, performance reports, and more. School management systems are essential for
educational institutions to provide a better academic experience to students and to manage their
activities effectively. They help school authorities maintain and keep track of administrative
activities in real-time, which would otherwise be time-consuming and require hard work. School
management systems also offer many features that help enhance the performance of schools
with minimum effort.
package schoolmanagement;

public class School {


private String name;
private int id;
private String address;
private String phone;
private String email;

public School(String name, int id, String address, String phone, String email) {
this.name = name;
this.id = id;
this.address = address;
this.phone = phone;
this.email = email;
}

public void display() {


System.out.println("School Name: " + name);
System.out.println("School ID: " + id);
System.out.println("Address: " + address);
System.out.println("Phone: " + phone);
System.out.println("Email: " + email);
}
}

package schoolmanagement;

public class Student extends School {


private String name;
private int rollNo;

public Student(String name, int rollNo, String schoolName, int schoolId, String address,
String phone, String email) {
super(schoolName, schoolId, address, phone, email);
this.name = name;
this.rollNo = rollNo;
}

public void display() {


super.display();
System.out.println("Student Name: " + name);
System.out.println("Roll No.: " + rollNo);
}
}
package schoolmanagement;

public class Teacher extends School {


private String name;
private int empId;

public Teacher(String name, int empId, String schoolName, int schoolId, String address,
String phone, String email) {
super(schoolName, schoolId, address, phone, email);
this.name = name;
this.empId = empId;
}

public void display() {


super.display();
System.out.println("Teacher Name: " + name);
System.out.println("Employee ID: " + empId);
}
}

package schoolmanagement;

public class Classroom extends School {


private int classNo;

public Classroom(int classNo, String schoolName, int schoolId, String address, String phone,
String email) {
super(schoolName, schoolId, address, phone, email);
this.classNo = classNo;
}

public void display() {


super.display();
System.out.println("Class No.: " + classNo);
}
}
package schoolmanagement;

public class Subject extends Classroom {


private String subjectName;

public Subject(String subjectName,int classNo,String schoolName,int schoolId,String


address,String phone,String email) {
super(classNo,schoolName,schoolId,address,phone,email);
this.subjectName=subjectName;
}

public void display(){


super.display();
System.out.println("Subject Name: "+subjectName);
}
}
package schoolmanagement;

public class Exam extends Subject {


private int examID;

public Exam(int examID,String subjectName,int classNo,String schoolName,int


schoolId,String address,String phone,String email){
super(subjectName,classNo,schoolName,schoolId,address,phone,email);
this.examID=examID;
}

public void display(){


super.display();
System.out.println("Exam ID: "+examID);
}

public static void main(String args[]){


School s1=new School("ABC School",1,"123 Main St","123-456-7890","[email protected]");
s1.display();
System.out.println("\n");

Student s2=new Student("akram",101,"ABC School",1,"123 Main St","123-456-


7890","[email protected]");
s2.display();
System.out.println("\n");

Teacher t1=new Teacher("naseem",201,"ABC School",1,"123 Main St","123-456-


7890","[email protected]");
t1.display();
System.out.println("\n");

Classroom c1=new Classroom(10,"ABC School",1,"123 Main St","123-456-


7890","[email protected]");
c1.display();
System.out.println("\n");

Subject sub1=new Subject("Maths",10,"ABC School",1,"123 Main St","123-456-


7890","[email protected]");
sub1.display();
System.out.println("\n");

Exam e1=new Exam(100,"Maths",10,"ABC School",1,"123 Main St","123-456-


7890","[email protected]");
e1.display();
}
}
The program school management system with 6 classes using inheritance, association, and
composition. The classes involved in this system are:

 School: This class contains the overall details of the school.


 Student: This class is the child class of School and contains the details of the students.
 Teacher: This class is the child class of School and contains the details of the teachers.
 Classroom: This class is the child class of School and contains the details of the classrooms.
 Subject: This class is the child class of Classroom and contains the details of the subjects.
 Exam: This class is the child class of Subject and contains the details of the exams.
 Inheritance: The Student and Teacher classes are child classes of the School class. This means
that they inherit the properties and methods of the School class.
 Association: The Classroom class has an association with the School class. This means that
the Classroom class has a reference to an instance of the School class.
 Composition: The Subject and Exam classes have a composition relationship with
the Classroom class. This means that the Subject and Exam classes are composed of one or
more instances of the Classroom class.

You might also like