I was trying to solve a car refueling question to decide the minimum number of refills. The program throws the above error at runtime.
Here is my code: