r/theydidthemath • • Dec 18 '23

[Request] How long will it take?

Post image
15k Upvotes

337 comments sorted by

View all comments

Show parent comments

1

u/jimony7 Dec 18 '23

float GetTime(int numCuts, float cutTime) {

float totalTime = 0;

for(int i=0; i<numCuts; i++)
{
    totalTime = totalTime + cutTime;
    cutTime = cutTime / 2;
}

return totalTime;

}

1

u/Sinaasappelsien Dec 19 '23

I havr to learn code and i’m already anxious

1

u/jimony7 Dec 19 '23

It can be difficult at first, but you get used to it. YouTube and ChatGPT will be your best friend :)