Sep-11-2018, 02:30 PM
(This post was last modified: Sep-11-2018, 02:30 PM by Travisbulls34.)
Hi everyone,
I'm new to the site and just started taking a beginners Python course. I was hoping to see if I could receive some assistance with an assignment I've been working on.
This is the problem I'm working on:
(Financial application: compound value) Suppose you save $100 each month into a savings account with an annual interest rate of 5%. Therefore, the monthly interest rate is After the first month, the value in the account becomes 100 * (1 + 0.00417) = 100.417 After the second month, the value in the account becomes (100 + 100.417) * (1 + 0.00417) = 201.252 After the third month, the value in the account becomes (100 + 201.252) * (1 + 0.00417) = 302.507 and so on. Write a program that prompts the user to enter a monthly saving amount and displays the account value after the sixth month. Here is a sample run of the program:
Enter the monthly saving amount: (WHATEVER NUMBER)
After the sixth month, the account value is (WHATEVER NUMBER)
This is the code I've used so far but I know it's not right. Just confused on how I should word the code so that it will just display the value after the 6th month!It displays the savings after the first month I just don't know how to word it to display the savings amount after 6th months in the savings account.
I'm new to the site and just started taking a beginners Python course. I was hoping to see if I could receive some assistance with an assignment I've been working on.
This is the problem I'm working on:
(Financial application: compound value) Suppose you save $100 each month into a savings account with an annual interest rate of 5%. Therefore, the monthly interest rate is After the first month, the value in the account becomes 100 * (1 + 0.00417) = 100.417 After the second month, the value in the account becomes (100 + 100.417) * (1 + 0.00417) = 201.252 After the third month, the value in the account becomes (100 + 201.252) * (1 + 0.00417) = 302.507 and so on. Write a program that prompts the user to enter a monthly saving amount and displays the account value after the sixth month. Here is a sample run of the program:
Enter the monthly saving amount: (WHATEVER NUMBER)
After the sixth month, the account value is (WHATEVER NUMBER)
This is the code I've used so far but I know it's not right. Just confused on how I should word the code so that it will just display the value after the 6th month!It displays the savings after the first month I just don't know how to word it to display the savings amount after 6th months in the savings account.
no1=eval(input("Enter the monthly saving amount:")) print((no1)*(1+0.00417)) no2=(no1)*((1+0.00417)**6) print((no1+no2)*(1+0.00417)) no3=(no1+no2)*(1+0.00417) print=((no1+no3)*(1+0.00417)) no4=(no1+no3)*(1+0.00417) print=((no1+no4)*(1+0.00417)) no5=(no1+no4)*(1+0.00417) print=((no1+no5)*(1+0.00417)) no6=(no1+no5)*(1+0.00417)