package app;

public class Halbjahresleistung {

    private int noteKlArb1;
    private int noteKlArb2;
    private int noteMuendlich;
    
    public void setNoteKlArb1(int pNoteKlArb1) {
        this.noteKlArb1 = pNoteKlArb1;
    }

    public int getNoteKlArb1() {
        return this.noteKlArb1;
    }

    public void setNoteKlArb2(int pNoteKlArb2) {
        this.noteKlArb2 = pNoteKlArb2;
    }

    public int getNoteKlArb2() {
        return this.noteKlArb2;
    }
    
    public void setNoteMuendlich(int pNoteMuendl) {
        this.noteMuendlich = pNoteMuendl;
    }
    
    public int getNoteMuendlich() {
        return this.noteMuendlich;
    }

    public double berechneNotendurchschnitt() {
        double schnittKlArb;

        schnittKlArb = (noteKlArb1 + noteKlArb2) / 2.0;
        
        return (3 * schnittKlArb + noteMuendlich) / 4;
    }
    
    public String ermittleZeugnisnote() {
        String schulnote;
        double schnittGesamt = this.berechneNotendurchschnitt();
        
        if(schnittGesamt>=12.5) {
            schulnote = "sehr gut";
        }
        else {
            if(schnittGesamt>=9.5) {
                schulnote = "gut";
            }
            else {
                if (schnittGesamt>=6.5) {
                    schulnote = "befriedigend";
                }
                else {
                    if (schnittGesamt>=3.5) {
                        schulnote = "ausreichend";
                    }
                    else {
                        if (schnittGesamt>=0.5) {
                            schulnote = "mangelhaft";
                        }
                        else {
                            schulnote = "ungen�gend";
                        }
                    }
                }
            }
        }
        
        return schulnote;
    } 
    
//    public String ermittleSchulnote() {
//        String schulnote;
//        double schnittGesamt = this.berechneNotendurchschnitt();
//        
//        if(schnittGesamt>=12.5) {
//            schulnote = "sehr gut";
//        }
//        else if(schnittGesamt>=9.5) {
//            schulnote = "gut";
//        }
//        else if (schnittGesamt>=6.5) {
//            schulnote = "befriedigend";
//        }
//        else if (schnittGesamt>=3.5) {
//            schulnote = "ausreichend";
//        }
//        else if (schnittGesamt>=0.5) {
//            schulnote = "mangelhaft";
//        }
//        else {
//            schulnote = "ungen�gend";
//        }
//        
//        return schulnote;
//    } 
    
} 