Write a program that declares and initializes a double variable. Then, round that number to the nearest whole number. Finally, multiply that new number by two and print it out. Challenge: use a Scanner to read in the initial double number from the user.
top of page
bottom of page
class Main { public static void main(String[] args) { double a = 7.5; long a2 = Math.round(a); double a3 = a2 * 2; System.out.println(a3); } }