Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package studentmanagementsystem;
- public class Student {
- private String name;
- private String id;
- private double cgpa;
- private int registrationFee;
- public Student(String name, String id, double cgpa, int registrationFee) {
- this.name = name;
- this.id = id;
- this.cgpa = cgpa;
- this.registrationFee = registrationFee;
- }
- public String getName() {
- return name;
- }
- public String getId() {
- return id;
- }
- public double getCgpa() {
- return cgpa;
- }
- public int getRegistrationFee() {
- return registrationFee;
- }
- void giving_online_exam() {
- System.out.println("Online exam");
- }
- String attendingOnlineClass() {
- return "attending online classes.";
- }
- }
- package studentmanagementsystem;
- public class Admin {
- void givingWavier(Student studentName) {
- if (studentName.getCgpa() > 3.8) {
- System.out.println(studentName.getName() + " recieve 10% waiver");
- }
- }
- void givingRegistraionClearance(Student studentName) {
- if (studentName.getRegistrationFee() >= 13500) {
- System.out.println(studentName.getName() + " clearance done");
- } else {
- System.out.println(studentName.getName() + " clearance incomplete");
- }
- }
- }
- package studentmanagementsystem;
- public class StudentManagementSystem {
- public static void main(String[] args) {
- Student arifin = new Student("Arifin", "192-35-2861", 3.88, 10000);
- System.out.println("Name - " + arifin.getName() + " ID -" + arifin.getId()
- + " GGPA -" + arifin.getCgpa());
- Student joy = new Student("joy", "192-35-2877", 3.68, 20000);
- System.out.println("Name - " + joy.getName() + " ID -" + joy.getId()
- + " GGPA -" + joy.getCgpa());
- Student ali = new Student("Ali", "192-35-2866", 3.98, 15000);
- System.out.println("Name - " + ali.getName() + " ID -" + ali.getId()
- + " GGPA -" + ali.getCgpa());
- Admin farzanaMam = new Admin();
- farzanaMam.givingWavier(arifin);
- farzanaMam.givingWavier(ali);
- farzanaMam.givingWavier(joy);
- farzanaMam.givingRegistraionClearance(arifin);
- farzanaMam.givingRegistraionClearance(joy);
- farzanaMam.givingRegistraionClearance(ali);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment