it's strange that when I type 2.4 or 2.2 for example I get the output 3 but when I type 2.5 in 2 gets returned which I expected,but I expected 2 to be printed when I typed anything less than < 5,when I type in 2.> 5 it outputs 3 which I want.
C:\Temp>test123
enter a double
2.1
2
C:\Temp>test123
enter a double
2.2
2
C:\Temp>
C:\Temp>test123
enter a double
2.11
3
C:\Temp>test123
enter a double
2.9
3
if you change line 5 to double roundNumber(double x){
I think you'll get better results, but it still not correct.
Hopefully that will help you find a solution.