Study

Math Methods in Java

  •   0%
  •  0     0     0

  • What is the output of Math.ceil(3.2)
    4.0
  • A warehouse packs boxes with whole items only. If you have 9.8 items worth of material, how many full boxes can you fill?
    9
  • System.out.println(Math.round(-2.5));
    -2
  • A student’s average is 76.7. Round it using Math.round()
    77.0
  • What is the result of Math.round(3.6)
    4
  • Compute the result of Math.floor(0.99)
    0.0
  • Evaluate Math.ceil(-4.7)
    -4
  • What will Math.ceil(0.001) return
    1.0
  • System.out.println(Math.abs(-5));
    5
  • Evaluate Math.floor(-2.3)
    -3.0