Test1A and save your class in a file named
Test1A.java.
submit 1020 Test1A Test1A.java
You may submit your solution more than once. Additional documentation about the
submit command can be viewed by typing man submit.
The amount of gold in grams:The entry has to be made on the same line as the prompt.
Here is a sample run (including the integer entered by the user):
The amount of gold in grams: 950
GoldPrice,
whose API can be found here.
Print the value using two digits of precision.
Here is a sample run (including the output and input of the earlier phases as well):
The amount of gold in grams: 950 The current value is $ 28722.83
The number of weeks ago?
Here is a sample run (including the output and input of the earlier phases as well):
The amount of gold in grams: 950 The current value is $ 28722.83 The number of weeks ago? 7
GoldPrice. If the current
value is greater, then a positive number is printed. If the current
value is smaller, the a negative number is printed. Print the difference
using two digits of precision.
Here is a sample run (including the output and input of the earlier phases as well):
The amount of gold in grams: 950 The current value is $ 28722.83 The number of weeks ago? 7 The difference is $ -1887.05
Here is another sample run (including the output and input of the earlier phases as well):
The amount of gold in grams: 1250 The current value is $ 37793.20 The number of weeks ago? 4 The difference is $ 2860.20