Complete the following code. Make sure to complete the code…
Complete the following code. Make sure to complete the code in such a way that doesn’t invalidate the comments and that no implicit conversions are taking place on assignments of primitive data types. [import] public class Test { public static void main(String[] args) { int num; double stockValue; // create a keyboard Scanner Scanner scanner = [init] // get an integer value from the user num = [int] // get a double value from the user stockValue = [double] // compute cost double cost = num * stockValue; // print cost to 2 decimal places [print] } }
Read Details