Ask coding questions

← Back to all posts
Ceiling function
BenPoulos (0)

I need help with this assignment for school and unfortunately, I am fully remote with teachers not really caring about teaching so learning is quite hard. I just need help getting a start or put on the right track for this assignment, the goal is to take any input and round it up to the closest number, like 2.9 to 3, -1.9 to -1, or 3.1 to 4. Any help would be greatly appreciated!

Comments
hotnewtop
[deleted]

It works, why are you type casting it into a int? It’s way more accurate as a double.

Dunce (65)

Hello, I don't know java, but I tried renaming "Program" to "Main". And that worked.
My understanding is that it has to have the same name as the file it runs in, that's what the error message said anyway.