Skip to content

Commit c6f00b5

Browse files
committed
Initial commit
0 parents  commit c6f00b5

File tree

12 files changed

+400
-0
lines changed

12 files changed

+400
-0
lines changed

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
### IntelliJ IDEA ###
2+
out/
3+
!**/src/main/**/out/
4+
!**/src/test/**/out/
5+
6+
### Eclipse ###
7+
.apt_generated
8+
.classpath
9+
.factorypath
10+
.project
11+
.settings
12+
.springBeans
13+
.sts4-cache
14+
bin/
15+
!**/src/main/**/bin/
16+
!**/src/test/**/bin/
17+
18+
### NetBeans ###
19+
/nbproject/private/
20+
/nbbuild/
21+
/dist/
22+
/nbdist/
23+
/.nb-gradle/
24+
25+
### VS Code ###
26+
.vscode/
27+
28+
### Mac OS ###
29+
.DS_Store

.idea/.gitignore

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/artifacts/Student_Management_System_jar.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Student Management System.iml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>

src/META-INF/MANIFEST.MF

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Main-Class: student.management.StudentManagement
3+

src/student/management/School.java

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package student.management;
2+
3+
import java.util.List;
4+
5+
public class School {
6+
// ArrayList to handle the objects of Teachers and Student classes
7+
private List<Teacher> teachers;
8+
private List<Student> students;
9+
private static int totMoneySpent;
10+
private static int totMoneyEarned;
11+
12+
public School(List<Teacher> teachers, List<Student> students) {
13+
this.teachers = teachers;
14+
this.students = students;
15+
totMoneyEarned = 0;
16+
totMoneySpent = 0;
17+
}
18+
//Setters for both the student and teacher.
19+
public void addStudent(Student s){
20+
students.add(s);
21+
}
22+
public void addTeacher(Teacher t) {
23+
teachers.add(t);
24+
}
25+
26+
public int getTotMoneyEarned() {
27+
return totMoneyEarned;
28+
}
29+
30+
public static void setTotMoneyEarned(int MoneyEarned) {
31+
totMoneyEarned +=MoneyEarned;
32+
}
33+
34+
public int getTotMoneySpent() {
35+
return totMoneySpent;
36+
}
37+
38+
public static void setTotMoneySpent(int moneySpent) {
39+
totMoneyEarned -= moneySpent;
40+
}
41+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package student.management;
2+
3+
4+
// to handle student's information.
5+
public class Student {
6+
private int id;
7+
private String name;
8+
private int feesPaid;
9+
private int fees;
10+
private int grade;
11+
12+
public Student(int id,String name,int grade){
13+
this.feesPaid = 0;
14+
if(grade<7) this.fees = 30000;
15+
else this.fees = 45000;
16+
this.id = id;
17+
this.name = name;
18+
this.grade = grade;
19+
}
20+
21+
public void updateTotalMoneyEarned(int currFees) {
22+
feesPaid += currFees;
23+
School.setTotMoneyEarned(feesPaid);
24+
}
25+
26+
public int getId() {
27+
return id;
28+
}
29+
30+
public String getName() {
31+
return name;
32+
}
33+
34+
public int getFeesPaid() {
35+
return feesPaid;
36+
}
37+
38+
public int getFees() {
39+
return fees;
40+
}
41+
42+
public int getGrade() {
43+
return grade;
44+
}
45+
46+
@Override
47+
public String toString() {
48+
return "Student{id=" + id + ", name='" + name + "', grade=" + grade +
49+
", feesPaid=" + feesPaid + ", totalFees=" + fees + "}";
50+
}
51+
52+
}

0 commit comments

Comments
 (0)