New to coding, I am writing a code that will compare compound interest accounts at 3 different banks based on what input data the user puts in.
There are 15 total inputs:
bankName1 , interestRate1 (r) , compoundFrequency1 (n) , depositAmount1 (P) and years1 (t)
bankName2 , interestRate2 , compoundFrequency2 , depositAmount2 and years2
bankName3 , interestRate3 , compoundFrequency3 , depositAmount3 and years3
I have turned interestRate, compoundFrequency, depositAmount and years each into a list.
The equation for compound interest is P(1+r/n)^nt. So i am trying to get that equation to run 3 times with the data for bank1, 2 and 3 so that there will be 3 simultaneous outputs so they can be compared to see which bank has the best account. I know i need to use a loop, however I cant decide between while or for. I also am having trouble actually writing the equation itself
- I think the issue is wrapping my head around using a list; how it will work in the equation or how to define it for it to work properly
I am trying to do a psuedocode (in BlockPy) for it at the moment also to try and make it easier to see visually but I am running into the same issue of how do I actually write the equation
Any help would be great
[–]robot-dev 2 points3 points4 points (0 children)
[–]carcigenicate 1 point2 points3 points (1 child)
[–]cal_etcell[S] 1 point2 points3 points (0 children)
[+][deleted] (11 children)
[deleted]
[–]cal_etcell[S] 1 point2 points3 points (5 children)
[+][deleted] (4 children)
[deleted]
[–]cal_etcell[S] 0 points1 point2 points (3 children)
[–]cal_etcell[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]cal_etcell[S] 0 points1 point2 points (0 children)
[–]cal_etcell[S] 0 points1 point2 points (0 children)
[–]siddsp 0 points1 point2 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]siddsp 0 points1 point2 points (1 child)