aykuta3474 / depoo

0 stars 0 forks source link

Ogrenci Bilgi Sistemi #34

Open aykuta3474 opened 2 years ago

aykuta3474 commented 2 years ago

public class Course { String name; int code; String prefix; int note; Teacher teacher;

 Course(String name,int code,String prefix){
    this.name=name;
    this.code=code;
    this.prefix=prefix;
    int note=0;
    //this.teacher=teacher;

}
void Addteacher(Teacher teacher){
     if(teacher.branch.equals(this.prefix)){
         this.teacher=teacher;
         PrintTeacherInfo();
     }
     else{
         System.out.println("maalesef hoca ile ders ayni bransta degil");
     }

}
void PrintTeacherInfo(){
     this.teacher.TeacherInfo();
}

}

aykuta3474 commented 2 years ago

public class Main { public static void main(String[] args) { Teacher t1 = new Teacher("ahmet", 7777, "Tarih"); Teacher t2=new Teacher("sevim",787878,"fizik"); //t1.TeacherInfo(); Course Tarih=new Course("Tarih",101,"Tarih"); Tarih.Addteacher(t1);

}

}

aykuta3474 commented 2 years ago

public class Student { / Student Sınıfı Özellikleri : Nitelikler : name,stuNo,classes,course1,course2,course3,avarage,isPass Metotlar : Student(), addBulkExamNote(), isPass(), calcAvarage(), printNote()/

Course c1;
Course c2;
Course c3;
String name;
int stuNo;
String classes;
double avarage;
boolean isPass;

 Student(String name,int stuNo,String classes,Course c1,Course c2,Course c3){
     this.name=name;
     this.classes=classes;
     this.stuNo=stuNo;
     this.c1=c1;
     this.c2=c2;
     this.c3=c3;
     this.avarage=0.0;
     this.isPass=false;
 }
 void addBulkExamNote(int not1,int not2,int not3){
     if((not1>0)&&(not1<100)){
    c1.note=not1;
     }
     if((not2>0)&&(not2<100)){
         c2.note=not2;
     }
     if((not3>0)&&(not3<100)){
         c3.note=not3;

     }

 }

}

aykuta3474 commented 2 years ago

/Nitelikler : name,mpno,branch Metotlar : Teacher()/ public class Teacher { String name; int mpno; String branch;

Teacher(String name,int mpno,String branch) {
    this.name=name;
    this.mpno=mpno;
    this.branch=branch;

}
void TeacherInfo(){
    System.out.println("Hocanin ismi :"+this.name);
    System.out.println("hocanin numarasi:"+this.mpno);
    System.out.println("hocanin bransi:"+this.branch);

}

}