40 pts.
 Visual Basic Get Average Change of Variable
So I have a variable that is being added to every minute and id like to know how I can get the average its being added to per minute. I know how to do the math but I cant figure out the code for it. Please anyone? Id like the actual code for it I know that's asking a lot but I just haven't been able to figure it out.

Software/Hardware used:
Visual Basic (VB.NET)
ASKED: September 11, 2012  1:08 AM
UPDATED: September 11, 2012  12:17 PM
  Help
 Approved Answer - Chosen by sherlockturtle (Question Asker)

This is ever x ammount of seconds to gather data.  OA is the variable thats going up.  AA starts of = 0. AB is the final number.  But it doesnt seem to work. aa += 1
If (aa = 0) Then
ab = oa
End If
If (aa = 5) Then
Label7.Text = (oa - ab) / aa
aa = 0
End If

ANSWERED:  Sep 11, 2012  2:54 AM (GMT)  by sherlockturtle

 
Other Answers:

Ohh sorry.  I didint know what the Check mark did.   By the way instead of aa = 0 it should be aa = -1.

Last Wiki Answer Submitted:  September 11, 2012  2:56 am  by  sherlockturtle   40 pts.
Latest Answer Wiki Contributors:  sherlockturtle   40 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Just subtract the initial value from the final value and divide by the number of minutes — (final – initial)/minutes — but it’s hard to be specific without seeing your definitions. — Tom

 110,135 pts.

 

The code is not sufficient. Clearly, aa has (1) added to it, but it’s not clear how it ever gets a value greater than (1). Is there a loop or an event that invokes this code? How is the time duration determined? Is this code called once every minute? I see that (ab = oa) when (aa = 0), but I don’t see any way for aa ever to have the value (0). Enough code must be shown so that the structure is visible. — Tom

 110,135 pts.