Dear Sir / Madam,

Please help me again on Delphi. Please help me to write a program that uses a function to caoculate the commission payable to the sales person, when passed the commission rate for the item, the total items sold and the price per item.
For example, if the commission rate was 2%, the total items sold was 5, and the price per item was $1200, then the function should return 120.

Cheers,

See we can help you out only when you get stuck in somewhere writing a code. It's your task to write the program.

Good luck,guy :)

program commission_rate;

{$APPTYPE CONSOLE}

uses
  SysUtils;
Var CoRate,ItSold,Prc:Integer;

(*this is our little function that will calculate the results*)
Function Something(CommissionRate,ItemsSold,Price:Integer):Real;
   Begin
      Something:=((Price/100)*CommissionRate)*ItemsSold;
   End;

Begin {main}
   {gathering data}
   Write('Give me the commission rate,only numbers: ');
   ReadLn(CoRate);
   Write('Now,give me the price of the item,only numbers: ');
   ReadLn(Prc);
   Write('And lastly,give me the number of the sold items: ');
   ReadLn(ItSold);
   {call our function,write the results}
   Write('The final result is: ',Something(CoRate,ItSold,Prc):3:0);
   ReadLn;
End.

{
-=Note By FlamingClaw=-

Of Course,tested.I tryed in Delphi 6 and working....

-=Created By FlamingClaw=-
--=2009.04.04=


}
Comments
He helps me a lot.
This question has already been answered. Start a new discussion instead.