Computer Applications
The AMB hotel gives the amount to be paid by the customer as an integer, which of the following Math method rounds off the bill in decimals to an integer?
- Math.round()
- Math.pow()
- Math.ceil()
- Math.abs()
Java Math Lib Methods
1 Like
Answer
Math.round()
Reason — The Math.round() method rounds a decimal number to the nearest integer. It returns the closest whole number, which is suitable for rounding off a bill amount to an integer.
Answered By
2 Likes
Related Questions
The sum of
a[1]anda[3]in the arrayint a[] = {20, 40, 60, 80, 100}is:- 80
- 100
- 120
- 60
State which access specifier is less restrictive.

- private
- protected
- default
- public
Identify which of the following leads to an infinite loop.
- for(i = 10; i != 0; i--)
- for(i = 3; i <= 30; i += 3)
- for(i = 1; i >= 1; i++)
- for(i = 1; i >= 0; i--)
Assertion: A class can have multiple constructors.
Reason: Multiple constructors are defined with same set of arguments.
- Assertion is true, Reason is false.
- Both assertion and Reason are false.
- Both assertion and Reason are true.
- Assertion is false, Reason is true.