-4
Avg = ((int)2*avg1 + 3*focavg + 5*critrating / 10);
System.out.println("Overall movie rating: " + Avg);

I stored Avg as a double and the instructions want me to round the output of this code to a whole number but, it always comes out as a decimal.

The Code output: Overall movie rating: 82.57666666666667

Is there a way I can round this up to 83?

Marcono1234
  • 5,856
  • 1
  • 25
  • 43
vxrse
  • 1

1 Answers1

0

You can try importing "java.lang.Math" and can use ceiling method of Math class in print statement: System.out.println("Overall movie rating: " + Math.ceil(Avg));