Einzelnen Beitrag anzeigen

Thorben_Ko

Registriert seit: 8. Jun 2007
86 Beiträge
 
#7

Re: Notendurchschnitt erechnen!

  Alt 12. Jun 2007, 10:55
ich hab das auch mal gemacht ( mein erste prog ), brauchst du wirklich für jedes fach ein Edit?

Ich poste mal wie ich es darmals gemacht habe.

Delphi-Quellcode:

procedure TForm1.Button1Click(Sender: TObject);
var
a : real;
begin
  if Edit1.Text = 'then
  Label1.Caption := 'Bitte die Noten oben eintragen.'
  else
  noten := noten + strtoint(edit1.text);
  count := count + 1;
  a := noten/count;
  label1.Caption := 'Ihr Notenschnitt ist: ' + Formatfloat('0.##', a);
  Edit1.text := '';
  Edit1.SetFocus;
end;
count und noten sind Klassen Variabeln vom Form

Vll hillft dir das ja was
  Mit Zitat antworten Zitat