//Python //loop

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

//Python //loop

Post by answerhappygod »

//Python
//loop
Python Loop 1
Python Loop 1 (123.08 KiB) Viewed 17 times
Python Loop 2
Python Loop 2 (375.96 KiB) Viewed 17 times
For this lab, write a python program so it will continuously be asking user for inputs to calculate the interest earned until the user enters number 0 (zero) in principle. Once the user enters any number less or equal to 0 in principle, the program will exist. Submit your python program and screenshot of your program output. HINT: Use while loop to ask user for inputs. Assuming the following variables: ● p holds the initial principle balance r holds the annual interest rate ● n holds how many times the interest compound in a year • t holds how many years will the acco earn interest To calculate ending total balance: ** • total = p*(1 + float( r / 100) / n) (n* t) interest total - p
Enter the starting principal, 0 to quit: 12000 Enter the annual interest rate : 1.95 How many times per year is the interest compounded? 365 For how many years will the account earn interest? 2 At the end of 2.0 years you will have $ 12,477.23 with interest earned $477.23 Enter the starting principal, 0 to quit: 3000 Enter the annual interest rate : 1.89 How many times per year is the interest compounded? 1 For how many years will the account earn interest? 1 At the end of 1.0 years you will have $ 3,056.70 with interest earned $ 56.70 Enter the starting principal, 0 to quit: 0 Program existing
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply