G-Love
asked on
Simple one for delphi newbie
Hi
I need help with a function that calculates costs of using the internet at a internet cafe. The cost is $25 per hour calculated half-hourly. So each half hour is 1 Unit. If the time is 30mins that should be 1 Unit and 31Mins 2 Units etc etc
I am having problems working out how many units have been used. At the moment if you have been using it for 30mins you are charged 2 Units(where it should be 1):
function GetUnits(pintTotalMins: Integer) : Integer;
begin
GetUnits := (pintTotalMins DIV 30) + 1
end;
Cheers,
S
I need help with a function that calculates costs of using the internet at a internet cafe. The cost is $25 per hour calculated half-hourly. So each half hour is 1 Unit. If the time is 30mins that should be 1 Unit and 31Mins 2 Units etc etc
I am having problems working out how many units have been used. At the moment if you have been using it for 30mins you are charged 2 Units(where it should be 1):
function GetUnits(pintTotalMins: Integer) : Integer;
begin
GetUnits := (pintTotalMins DIV 30) + 1
end;
Cheers,
S
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.