Dear All
I'm very new to C# codes. I don't have background in programming and I have a project that I need to build basic logic to be run on a real time data. Here is what I'm trying to do.
1. Calculate a difference between current value and previous value and output the result
2. Calculate the Sum for the difference over 15 sec and output the result.
I'd really appreciate it if you could help me with this.
Thank you
MayankPosted Nov 21, 2016, 5:21 AM
Ans. Suppose u have two variables current and previous.
a. sumOfDifference=0
current=5, previous=4
differnce=1
sumOfDifference=differnce+sumOfDifference=1
b. Then u assign previous=current
previous=5
and take current value
current=9
difference=4
sumOfDifference=differnce+sumOfDifference=5
repeat above two steps in a loop and get ur output.
Q 2.Calculate the Sum for the difference over 15 sec and output the result.
Ans. sumOfDifference=will be your result
If u think it resolve your issue please marked as answer.