Hackerrabk question - rounding grades

Please everyone, I just joined Hackerrank and the first question I encountered seem like something I can’t do. Help me please, it is about a round up students marks to the nearest multiple of 5…below is the screenshot of the question. I have made attempt with if else statement but it isn’t working.

Please maybe you have come across something like this before…help me please I’m stuck

what issue are you having with it? first, do you understand what you would need to do to make the work manually?

I moved your question to its own topic because you were asking a question related to your own code for a challenge and were not answering the OP of the other thread. It is always best to create your own thread for you specific question(s).

Thank you.

It is much better for your own learning process if you tell us what you’ve tried, what you think the approach should be, your existing code etc. This way we can pinpoint issues that may be present in your logic.

I can try to provide vague hints here:

  1. What are the two base cases that you can encounter given any input?
  2. How can one determine if a number is closer to the next multiple of 5 without knowing that number beforehand? (the code can be very short and simple)

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.