Question: Compute Java ProgramRay Shimlock bought three types of stocks - Real Estate, Bonds and International. He bought 3 stocks in Real Estate, 2 stocks in

Compute Java ProgramRay Shimlock bought three types of stocks - Real Estate, Bonds and International. He bought 3
stocks in Real Estate, 2 stocks in Bonds and 2 stocks in International. At the end of the year, he
made 2.7% profit in Real Estate stocks, 1.89% profit in Bonds stocks and -1.34% profit (actually a
loss) in International stocks. Compute the net profit or loss for Ray at the end of the year.
Programming requirements
You must introduce 3 variables for Real Estate stocks, 2 variables for Bonds stocks and 2
variables for International stocks. Declare them all as double.
You must read all the values for these variables from the input. Use your own values. Suggested
value for a stock is between 500.00 to 1000.00.
Calculate the profit/loss as follows:
Add the 3 Real Estate stocks and multiply it with 0.027. Let us call this as result1
(declared as double).
Add the 2 Bonds stocks and multiply it with 0.0189. Let us call this as result2(declared
as double).
Add the 2 International stocks and multiply it with -0.0134. Let us call this as result3
(declared as double).
Add all the three results above. This is the net profit or loss. A positive value indicates
that it is a profit; a negative value means it is a loss.
You must print all the values - all stocks and the net profit/loss, with appropriate captions.
 Compute Java ProgramRay Shimlock bought three types of stocks - Real

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!