Hallo und

im Delphi-Forum!
Die Aufgabe ist relativ schlicht. Ich würde zunächst Konstanten für die Umrechnungskurse anlegen. Wenn du wenig denken willst, legst du einfach so viele an, wie es Umrechnungsmöglichkeiten gibt. Mit ein bissel Grips sind es nur halb so viele.
Konstantendeklaration:
Delphi-Quelltext
1: 2: 3: 4: 5: 6:
| const EurUSD = 1,2275; EurGBP = 0,6826; EurJPY = 134,5094; ... ... |
Und dann schaust du, welche Umrechnung erfordert ist:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9:
| If (ComboBox1.ItemIndex = 0) and (ComboBox2.ItemIndex = 1) then Edit2.Text := floattostr(strtofloat(Edit1.Text)*EurUSD);
If (ComboBox1.ItemIndex = 0) and (ComboBox2.ItemIndex = 2) then Edit2.Text := floattostr(strtofloat(Edit1.Text)*EurGBP); ... ... |
So, das wäre die sehr arbeitsaufwenige Methode für Anfänger, die ohne weitere Denkansprüche funktioniert. Die muss nicht weiter kommentiert werden, sie ist halt auf die Ansprüche, besonders auf die NICHT-Ansprüche des Fragestellers eingegangen.
