Autor Beitrag
jackie05
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Mi 01.04.09 01:03 
Hallo nochmal,
ich möchte bei mir im Programm eine Notenberechnung einbauen und weiss leider nicht weiter.
Ich habe schon google befragt nach Notenberechnung und hier im Forum, ich komme einfach nicht weiter.

Ich möchte zu diese 2 Labels: Richtig und Falsch die Note berechnen und in Label4 dann übergeben:

Label1: Richtig
Label2: Falsch
Label3: % richtig
Label4: Note

Die Prozentzahl war kein problem zu berechnen:
ausblenden Delphi-Quelltext
1:
2:
ProzentRichtig := round(Richtig*100 / (Falsch+Richtig));
lblProzentRichtig.Caption := '% richtig: '+IntToStr(ProzentRichtig);


Wie kann ich jetzt die Note berechnen?

Ich bedanke mich schonmal im Voraus.

MfG
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 01.04.09 01:10 
Nabend,
wie sieht denn dein Notensystem aus? Wie berechnen sich denn formal die Noten? :nixweiss:
Ich kenne in Rheinland-Pfalz nur folgendes System: Ab 40% richtiger Antworten gibt es 3 Punkte. Für jedes 5% mehr, gibt es je einen Punkt dazu.
Also wären folglich 80% richtiger Antworten 12 Punkte respektive eine 2+.

Grüße,
Marc.
jackie05 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Mi 01.04.09 01:17 
Danke erstmal für die schnelle antwort.

Ich weiss es nicht, ich habe erstmal mit dem Taschenrechner versucht die formel herauszubekommen :wink:

Ich kenne eine Mathe Seite indem z.B. folgendes steht:
Richtig:6
Falsch:2
% richtig:75
Note:3

Nur weiss ich nicht, wie man die Note so herausbekommt.

Wie könnte man das am einfachsten machen?

MfG
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mi 01.04.09 01:24 
Ein Beispiel wurde ja schon genannt. In dem Fall könntest du die Punkte ja berechnen und die Noten zu den Punkten könntest du in einem konstanten Array speichern.
ausblenden Delphi-Quelltext
1:
2:
3:
const
  Notes: array[0..15of String = ('6''5-''5''5+''4-''4''4+',
    '3-''3''3+''2-''2''2+''1-''1''1+');
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Mi 01.04.09 02:28 
user profile iconjaenicke hat folgendes geschrieben Zum zitierten Posting springen:
Ein Beispiel wurde ja schon genannt. In dem Fall könntest du die Punkte ja berechnen und die Noten zu den Punkten könntest du in einem konstanten Array speichern.
ausblenden Delphi-Quelltext
1:
2:
3:
const
  Notes: array[0..15of String = ('6''5-''5''5+''4-''4''4+',
    '3-''3''3+''2-''2''2+''1-''1''1+');

Man merke: Notes != Marks / Grades :mrgreen:

So, hier mal schnell runtergetippt eine Beispielklasse für das NotenSystem.
Ich hoffe, das hilft dir etwas weiter. ;)
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
type
  TNotenSystem = class
    private
      fCorrect: Integer;
      fWrong: Integer;
      function GetPercent: Single;
      function GetCount: Integer;
      function GetMark: String;
    public
      property CorrectAnsweresCount: Integer read fCorrect write fCorrect;
      property WrongAnsweresCount: Integer read fWrong write fWrong;
      property TotalAnsweresCount: Integer read GetCount;
      property Percents: Single read GetPercent;
      property Mark: String read GetMark;
  end;

var
  Form1: TForm1;
  NotenSystem: TNotenSystem;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
   NotenSystem := TNotenSystem.Create;
   try
     NotenSystem.WrongAnsweresCount := 8;
     NotenSystem.CorrectAnsweresCount := 2;
     Listbox1.Items.Add(IntToStr(NotenSystem.TotalAnsweresCount));
     Listbox1.Items.Add(FloatToStr(NotenSystem.Percents));
     Listbox1.Items.Add(NotenSystem.Mark);
   finally
     NotenSystem.Free;
   end;

end;

{ TNotenSystem }

function TNotenSystem.GetMark: String;
const
  Marks: array[0..15of String = ('6''5-''5''5+''4-''4''4+',
    '3-''3''3+''2-''2''2+''1-''1''1+');
begin
  result := Marks[Trunc(Percents / 5) - 3];
end;

function TNotenSystem.GetCount: Integer;
begin
  result := CorrectAnsweresCount + WrongAnsweresCount;
end;

function TNotenSystem.GetPercent: Single;
begin
  result := (CorrectAnsweresCount * 100 / TotalAnsweresCount);
end;


Guden Nacht,
Marc.