Autor Beitrag
elle333
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Sa 02.10.10 18:51 
Hallo
wir sollen für den informatik unterricht ein delphi programm machen in welchen man die die mehrwertssteurer und den bruttobetrag eines bestimmten geldbetrages berechnen kann.

Allerdings bin ein ziemlich anfänger in diesem bereich.
Über ein paar tipps oder links wäre ich dankbar.

Vielen Dank im Vorraus


Zuletzt bearbeitet von elle333 am Sa 02.10.10 18:52, insgesamt 1-mal bearbeitet
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 02.10.10 18:51 
Hi und :welcome: im Forum!

Ich empfehle Dir dazu erstmal die Basics anzueignen.

Siehe:
o Delphi-Wikibook
o user profile iconChristians Crashkurs

Damit alleine sollte bereits einiges klarer werden. :)

Beste Grüße,
Marc

Für diesen Beitrag haben gedankt: elle333
elle333 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Sa 02.10.10 18:52 
ok danke
ich werd es mir mal anschauen :D
elle333 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Sa 02.10.10 20:33 
ok ich hab jetzt mal was gemacht, aber das funktioniert nicht.
Kann jemand mal schauen wieso??

ul.to/g7asfh
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 02.10.10 20:35 
user profile iconelle333 hat folgendes geschrieben Zum zitierten Posting springen:
ok ich hab jetzt mal was gemacht, aber das funktioniert nicht.
Kann jemand mal schauen wieso??

ul.to/g7asfh

Bist Du so freundlich und hängst den Code hier via [delphi]Code[/delphi] an. :zustimm:
elle333 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Sa 02.10.10 20:37 
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:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    EdBetr: TEdit;
    EdMWSt: TEdit;
    EdGesa: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    BuMWSt: TButton;
    procedure BuMWStClick(Sender: TObject);

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}


procedure TForm1.BuMWStClick(Sender: TObject);
var a, b, c: Real;
begin
  a := StrToInt(EdBetr.Text);
  b := a * 0.19;
  EdMWSt.Text := IntToStr (b);
begin
  c := a + b
  EdGesa.Text := IntToStr (c);
end;

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

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 02.10.10 20:41 
Er müsste vermutlich sowas wie ';' expected but '.' found melden. Das zweite begin ist also redundant. ;)

Der Datentyp Real ist übrigens veraltet. Nutze besser Extended oder Double.


Zuletzt bearbeitet von Marc. am Sa 02.10.10 20:43, insgesamt 1-mal bearbeitet
elle333 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Sa 02.10.10 20:42 
unteranderem :D
Das sind die restlichen fehlermeldungen

[Fehler] Unit1.pas(40): Es gibt keine überladene Version von 'IntToStr', die man mit diesen Argumenten aufrufen kann
[Fehler] Unit1.pas(43): Operator oder Semikolon fehlt
[Fehler] Unit1.pas(43): Es gibt keine überladene Version von 'IntToStr', die man mit diesen Argumenten aufrufen kann
[Fehler] Unit1.pas(46): ';' erwartet, aber '.' gefunden
[Fehler] Unit1.pas(49): Deklaration erwartet, aber Dateiende gefunden
[Fataler Fehler] Project1.dpr(5): Verwendete Unit 'Unit1.pas' kann nicht compiliert werden
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 02.10.10 20:45 
Jap. Real, Extended und Double repräsentieren Fließkommazahlen. Also beispielsweise 3,141.
Ein Integer dagegen steht für eine Ganzzahl. Beispielsweise 4, 5, 123 oder was auch immer.

Du brauchst nun also das Äquivalent zu IntToStr() für Fließkommazahlen:
FloatToStr() respektive StrToFloat().

Grüße
elle333 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Sa 02.10.10 20:52 
ok
und was ist gemeint mit operator oder semikolon fehlt

 EdGesa.Text := FloatToStr (c);
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 02.10.10 20:54 
user profile iconelle333 hat folgendes geschrieben Zum zitierten Posting springen:
ok
und was ist gemeint mit operator oder semikolon fehlt

Schau Dir nocheinmal genau Deinen Quelltext an. :roll:
ausblenden Delphi-Quelltext
 
42:
43:
{ ... }
  c := a + b
  EdGesa.Text := IntToStr (c);
elle333 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Sa 02.10.10 20:56 
user profile iconMarc. hat folgendes geschrieben Zum zitierten Posting springen:
user profile iconelle333 hat folgendes geschrieben Zum zitierten Posting springen:
ok
und was ist gemeint mit operator oder semikolon fehlt

Schau Dir nocheinmal genau Deinen Quelltext an. :roll:
ausblenden Delphi-Quelltext
 
42:
43:
{ ... }
  c := a + b
  EdGesa.Text := IntToStr (c);


mensch bin ich dumm ^^
muss man eigentlich sehen, dass da semikolon fehlt
ja klar danke jetzt klappt es reibungslos