Question: Consider the following code fragment: Scanner console = new Scanner(System.in); System.out.print(How much money do you have? ); double money = console.nextDouble(); Describe what will happen
Consider the following code fragment:
Scanner console = new Scanner(System.in);
System.out.print("How much money do you have? ");
double money = console.nextDouble();
Describe what will happen when the user types each of the following values. If the code will run successfully, describe the value that will be stored in the variable money .
a. 34.50
b. 6
c. $25.00
d. million
e. 100*5
f. 600x000
g. none
h. 645
Step by Step Solution
3.39 Rating (165 Votes )
There are 3 Steps involved in it
a 3450 The code will run successfully and the variable money will store the value 345 b 6 The code ... View full answer
Get step-by-step solutions from verified subject matter experts
