Question Help Stopwatch

leo4all

Member
Joined
Dec 15, 2011
Messages
10
Programming Experience
Beginner
with a program neovjitet (stopwatch), which can transfer from tiemr1 to timer4 or to timer 2.
I want the button to leave this example: 00 Hr 05 min 00 and that starts to count from the back and to tell me how much money this koh must be paid to

and time is:
0min to 24 to 20 eu
24 min to 36 to 30 eu
36 min to 48 to 40 eu
48 min to 60 to 50 eu
automatically and when to add each 12 min + 10 eu ie when done 01hr: 22min automatically pay out 60 eu.
 
Why do you want to use multiple timers for this?
It would be significantly easier to keep the count on one timer, and then use a bit of math to calculate the amount of money from that timer.
 
I generally prefer to let people do their own programming, otherwise they won't learn how it's done and ultimately cannot maintain it. I am also unable to build it for you because I don't know what code and controls you've already got.
I can however give you some suggestions:

Use an if_then_else statement to check whether the time is less than 24 minutes.
If it is less than 24 then the payment is simply 20.
If not, the payment is 10 multipled by the number of twelve minute blocks you need before you get to that time.
This means that, when m is the number of minutes, then payment p should be
p = 10*Math.Ceiling(M/12)
 
to forgive but I understand for themselves and make un error scans
 If sec.Text <22 Then
             lblCmimi.Text = "20 Den"
         else
             If sec.Text> 23 Then
                 lblCmimi.Text = "30 Den"
             End If
         End If


         If sec.Text> 35 Then
             lblCmimi.Text = "40 Den"
         End If

         If sec.Text> 47 Then
             lblCmimi.Text = "50 Den"
         End If

         If min.Text = 1 Then
             sec.Text = "24"
             lblCmimi.Text = "60 Den"
             If min.Text = 1 Then
                 sec.Text = "36"
                 lblCmimi.Text = "70 Den"
             else

                 If min.Text = 1 Then
                     sec.Text = "36"
                     lblCmimi.Text = "80 Den"
                 else

                     If min.Text = 1 Then
                         sec.Text = sec.Text = 48
                         lblCmimi.Text = "90 Den"
                     End If
                 End If
             End If
         End If


but this procedure does not work because it becomes neqoft 1 min to 24 sec to 60 out of the den and den me out 70

to forgive but I understand I do error scans for himself


but this procedure does not work because if it becomes 1 min to 24 sec to 60 out of the den and me to appear del 70 den
 
I suspect that part of the reason that you're not managing this is that you're trying to treat text as though it were a number. Even if the contents of a text box is clearly a number to you or I, the computer sees it as a string of digit characters.

The second problem with your approach is that whenever there is a minute involved, your second box isn't inside an If statement.
Either you'd need
If min = 1 then
If Sec > 24 then

....

or you'd need
If min = 1 and Sec > 24.

I would suggest that you convert the text to numbers and then use an equation such as the one I gave you earlier. This prevents you from needing to hard code all possible values.
 
Back
Top