logo CodeStepByStep logo

investment

Write a function named investment that calculates money earned by two investors. Use the following compound interest formula:

PV * (1 + r)n = FV

Also report the overall "quality" of the investment as from the table below:

Profit Category
0 - 10% weak
10 - 50% medium
over 50% strong

Match the following example output log (with user input shown like this):

Investor #1:
Initial amount? 100
Interest rate ? 3
Num. of months? 5
Final amount = $115.93
Profit = $15.93 (16%)
medium

Investor #2:
Initial amount? 5
Interest rate? 8
Num. of months? 24
Final amount = $31.71
Profit = $26.71 (534%)
strong

Have a nice day!

You should break down your program into several functions, each of which helps solve the overall problem.

Complete program: Write an entire program that you could put into a file and run outside of CodeStepByStep.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.