I have a problem when I want to calculate the following:
Let's say that I have an online class for only 5 students. The class costs **6000 NOK per student.** I want to withdraw money every 5 seconds. If we calculate the cost for 5 seconds, we need to calculate the cost for one second which would be:
6000 NOK/3600 = 1.666666666666667 and let's approximate the result to 1.67 NOK per second.
So every 5 seconds I have to withdraw:
5x1.67 = 8.35 NOK
Let's say that the class lasted for 1 hour. That means 3600/5 = 720 times I have to charge the students. I end up charging every student with this amount
720x8.35 = 6012 NOK
So my question is that there is a difference between the initial cost of the class which is 6000 NOK, but in the end, I charged 6012 NOK from each student. How do I solve this issue when I write this in code?
Thanks in advance.