This is great if you want to round to the nearest integer. But sometimes you will want to keep a certain number of decimal places; when working with money for example you normally want to keep 2 decimal places (for dollars and cents).Your problem: Write an expression (or several expressions) that will round the variable x to 2 decimal places. It should work for any value that is stored in x. This should not produce a String it must produce an actual double value! Just printing out the rounded value is not enough the rounded value must be stored back in a double variable.For example:
double x = 123.25032;
double z = [YOUR EXPRESSION HERE]
Your expression should result in z == 123.25.If x = 52.118907 then z == 52.12.
If x = 9.4512 then z == 9.45.
If x = 9.455 then z == 9.46.