Question: PROGRAMMING LANGUAGE IS JAVA Given the integer variable numUnits, type cast numUnits to a double and assign the value to the variable newUnits. Ex: If
PROGRAMMING LANGUAGE IS JAVA

Given the integer variable numUnits, type cast numUnits to a double and assign the value to the variable newUnits. Ex: If the input is 8 , then the output is: 8.0 \begin{tabular}{l|l} 1 & import java. util.Scanner; \\ 2 & \\ 3 & public class Doubleconverter \{ \\ 4 & public static void main(String args [ ]) \{ \\ 5 & Scanner scnr = new Scanner(System.in); \\ 6 & int numUnits; \\ 7 & double newUnits; \\ 8 & \\ 9 & numUnits = scnr. nextInt(); \\ 10 & \\ 11 & / Your code goes here */ \\ 12 & System.out.println(newUnits); \\ 13 & S \\ 14 & S \\ 15 & \end{tabular}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
