Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language: C++ Alice and Bob want to invest same amount of money, but at different interest rates. For Alice, her interest is a simple interest,

Language: C++

image text in transcribed

Alice and Bob want to invest same amount of money, but at different interest rates. For Alice, her interest is a simple interest, which means she gets the same interest every year Her interest rate is based on the amount of money she invests at the beginning. e.g. If Alice invests $200, her interest rate is 8%. She earns 8% of the original investment (200 * 0.08-$16) every year. So, she gets $16 for the interest every year. Invest $1- $99 $100 $299 300 $499 $500 $1000 >$1000 Interest Rate | 7% (0.07) 896(0.08) 996(0.09) 10% (0.10) 11% (0.11) For Bob, he invests the same amount of money at 3% compound interest. That is, interest is 3% of the current balance, including previous additions of interest. e.g. Bob earns 3% of $200 at the first year ($200 * 0.03-$6), giving him $206. The next year, he will earn 3% of $206 for interest, and so on. Write a program to figure out how many years it takes for the balance of Bob's investment to exceed the balance of Alice's investment, and display the balance of both investments at that year 1.(1 ptr) Decimals are involved, use double instead of int to declare your variables. (e.g. double aliceRate:) Because Bob's interest rate is fixed at 3%, declare it using const. 2. (2 ptrs) Ask user (Alice) to enter the original investment, Bob's investment will be set to the same amount. Check user input, if the number is less than 1, set the investment amount to $1. Display the original investment amount for Alice and Bob. 3. (3 ptrs) Using if/else if statement to decide what is the proper interest rate for Alice (which is based on her original investment amount.) Display the interest rate for Alice and Bob 4. (3 ptrs) Using loops to find out how many years it takes for the balance of Bob's investment to equal to or exceed the balance of Alice's investment. 5. (1 ptr) Display the result to the screen (the year, Alice's balance and Bob's balance at that year)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions