The Question

Write a program called Q2.java that creates a random investment (of type type.lib.Investment) and print it out using the toString() method of Investment. Also print out the total value of this investment.

The output should conform to that in the sample runs of a correct program shown below. Note that, in these sample runs, the % sign is not part of the output.

Sample Runs

% java Q2
The investment is: .UV UNIFORM of VICTOR Company QTY=1995 BV=15.76963752609286
Total value is $31,460.43
%
%
% java Q2
The investment is: .FM FOXTROT-MIKE Inc. QTY=668 BV=42.887561270008895
Total value is $28,648.89
%
%
% java Q2
The investment is: .RO The ROMEO OSCAR Corporation QTY=3581 BV=17.25437096721732
Total value is $61,787.90
%

Useful APIs

Here (again) are the common APIs that you may access:

Java 1.5 API
Type API

Submitting Your Work

Here is the command to submit your work (further details regarding the submit command can also be obtained by typing man submit
Once again, you are encouraged to submit regularly. Newer submissions overwrite older ones.

submit 1020 midtermR7 Q2.java