Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

=+2 How does the preparation and support for each type of IE vary?

Answered: 1 week ago

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago