Question: C: Write a code to input the following and calculate compound Interest using the formula: You need to input value and validate that the value
C:
Write a code to input the following and calculate compound Interest using the formula:
You need to input value and validate that the value cannot be negative. Your program should end, when p is 0

Please enter a value for the number of years (n): 12 The final value (F) is: 11908.90 Please enter a value for the principal (P) (To end program, enter o for the principal) Q Please enter a value for the principal (P) (To end program, eter o for the principal): 1000 Please enter a value for the interest rate (r): s Please enter a value tor the number of years (n): 20 The final value (F) is: 3207.14 Please enter a value for the principal (P) (To end program, enter o for the principal): 5000 Please enter a value for the interest rate (r): -7.5 ERROR-Please try again
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
