Question: My code needs to be fixed. First Picture shows the results after it failed in a test. The second picture is a picture of my

My code needs to be fixed. First Picture shows the results after it failed in a test. The second picture is a picture of my code. Please Write a new code that will fix this problem and make me pass the test

MUST BE CODED IN C++

My code needs to be fixed. First Picture shows the results afterit failed in a test. The second picture is a picture of

test_1 (test_simple.TestSimpleArithmetic) (0.0/2.0) Your output: Initial investment? Yearly growth rate? Yearly withdraw amount? Desired balance? Year: 80 Balance at end: 1.0247e+06 Amount withdrawn over period: 4000 Expected output: Initial investment? Yearly growth rate? Yearly withdraw amount? Desired balance? Years: 80 Balance at end: 1.0247e+06 Amount withdrawn over period: 4000 Diff view ('+' is expected output, '-' is your output): - Initial investment? Yearly growth rate? Yearly withdraw amount? Desired balance? Year: 80 ? + Initial investment? Yearly growth rate? Yearly withdraw amount? Desired balance? + Years: 80 Balance at end: 1.0247e+06 Amount withdrawn over period: 4000 Test Failed: your program didn't produce the correct output. 1 #include using namespace std; 2 3 4 5 int main() { float amnt, d_balance, rate, withdrw, flag-o; int cnt=0; 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 cout >amnt; cout >rate; cout>withdrw; cout>d_balance; while(amnt0) { amnt - amnt + amnt*rate; // Money Growth Per Year 21 22 23 24 29 cnt++; if(amnt

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!