Solved

mathmatic

Posted on 2003-12-08
4
176 Views
Last Modified: 2010-04-05
Hi Iam working on internet cafe project(prepaid)  Ihave 2 editboxes named value (number)  and period (time)  Iwant full  function to count the period from value .
0
Comment
Question by:sraab2004
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 7

Expert Comment

by:Motaz
ID: 9902454
What do u mean by period, and what is value??
please give example of data and the output you want, example:

value = 50
period (time) = 10 hours or (time) = '12:23 pm'

Motaz
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9902461
just to agree with motaz, give a result-sample
0
 
LVL 7

Accepted Solution

by:
Motaz earned 70 total points
ID: 9902474
If I understand u, suppose that value is the money, and period is the time payed for that amount of money, and 1$ = 1 hour (60 minutes) of time, then the function could be:

function GetPeriod(Value: Double): Integer;
begin
  Result:= Round(Value * 60);
end;

example

  edPeriod.Text:= IntToStr(GetPeriod(StrToFloat(edValue.Text)));

Motaz
0
 
LVL 7

Expert Comment

by:Motaz
ID: 9902490
I forget to mention that the result is minutes, for example

if you enter 1 you will get 60 minutes
2 = 120 minutes, and so on

Motaz
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question