Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Calculate denominations

jade1jade1 Member Posts: 59
Hi again.


unit Unit1;

interface

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

type
TfrmMakeChange = class(TForm)
lblAmount: TLabel;
edtAmount: TEdit;
sedAmount: TSpinButton;
lblChange: TLabel;
lblFifty: TLabel;
lblTwenty: TLabel;
edtTwenty: TEdit;
edtFifty: TEdit;
lblTen: TLabel;
edtTen: TEdit;
lblFive: TLabel;
edtFive: TEdit;
lblTwo: TLabel;
edtTwo: TEdit;
edtOne: TEdit;
lblOne: TLabel;
btnRetry: TBitBtn;
BitBtn2: TBitBtn;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
frmMakeChange: TfrmMakeChange;

implementation

{$R *.DFM}

procedure TfrmMakeChange.FormCreate(Sender: TObject);
begin

end;

end.

I want ot make the following program to use the MOD and DIV.
I was thinking of using a procedure called CalcDenom that can
be called 5 times from the event handler to reduce the duplication
of code.The procedure should have 3 parameters , one for each denomination
(50,20,etc.),one for total amount of rands,and one for the edit component
that must be used to display the number of coins and notes of that
denomination.
Please help as this is my last little hurdle before I can put I big
application together.

Thanx
JaDe1



Sign In or Register to comment.