Consider the following code fragment: Scanner console = new Scanner(System.in); System.out.print(How much money do you have? );
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 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
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Question Posted: