Question

# Ask the user for their name. # Ask the user for the bank/institution name. #...

# Ask the user for their name. # Ask the user for the bank/institution name. # Ask the user for their initial investment amount. # Ask the user for three(3) different annual interest rates # Ask the user for two(2) different lengths of investment (as an integer in years) # Compute the value of their investment after the number of years & at each rate #print results

I'm using python version 3.7

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Python Program:

""" Python program that reads data from user and performs investment calculations """

# Reading data from user
userName = input("Enter your name: ")
bankName = input("Enter your Bank/Institution name: ")
initialInvAmt = float(input("Enter your initial investment amount: "))

# List that holds annual interest rates
annIntRates = []
print("Enter three annual interest rates: ")
for i in range(3):
   annIntRates.append(float(input()))

# List that holds different lengths of investment
investments = []
print("Enter two different lengths of investment: ")
for i in range(2):
   investments.append(int(input()))
      
# Iterating over each investment year
for i in range(2):
   yr = investments[i]
   # Iterating over annual interest rates
   for j in range(3):
       intRate = (annIntRates[j] / 12.0) / 100.0
       # Calculating future value
       futureValue = initialInvAmt * ( ( 1 + intRate) ** (yr * 12) );
       print("\n Years: " + str(yr) + ", Interest Rate: " + str(annIntRates[j]) + "% \t FutureValue: " + str(round(futureValue, 2)))
      

____________________________________________________________________________________________________

Sample Run:

Add a comment
Know the answer?
Add Answer to:
# Ask the user for their name. # Ask the user for the bank/institution name. #...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Savings Exercise The idea here is to see how many years it will take a bank...

    Savings Exercise The idea here is to see how many years it will take a bank account to grow to at least a given value, assuming a fixed annual interest. Write a program savings.py. Prompts the user for three numbers: an initial balance, the annual 3.3. While Statements 145 Hands-on Python Tutorial, Release 1.0 for Python Version 3.1+ percentage for interest as a decimal. like .04 for 4%, and the final balance desired. Print the initial balance, and the balance...

  • Ask the user to enter a message Ask the user how many time they want to...

    Ask the user to enter a message Ask the user how many time they want to print the message Then use "while","do-while" and "for" loop to print the message. Show the number at the beginning of the lines when printing. For example: Enter your message: Welcome to Java How many time you want to print this message: 3 Using "while" loop: 1=> Welcome to Java 2=> Welcome to Java 3=> Welcome to Java Using "do-while" loop: 1=> Welcome to Java...

  • Ask the user for the name of a file. Read a list of numbers of unknown...

    Ask the user for the name of a file. Read a list of numbers of unknown length from the file. Find and print the MEDIAN and the MODE(S) of the set of numbers. Do not use python statistics functions to find the medium or mode To find the MODE(S) Create a dictionary using the numbers as the keys, and the values are how often that number appears in the list. For instance, with this list [1,1,5], the dictionary would be...

  • Write a code using loop and flag function in python jupitior notebook: Ask the user for...

    Write a code using loop and flag function in python jupitior notebook: Ask the user for the number of items they bought. Also ask the price of each item they bought and quantity purchased. Display the total amount they owe. Ask the user for a number n. Calculate 1+2+3+….+n. Ask the user for a number n. Calculate 1*2*3*…*n. Ask the user for number of rows (r) and columns (c). Print * for r rows and c columns. Ask the user...

  • PYTHON Ask the user for an integer number n. Construct, using one single loop, the list...

    PYTHON Ask the user for an integer number n. Construct, using one single loop, the list with the values   [1,2,3,4,…,n] and  the list with the values  [1^2 ,2^2 ,3^2 ,…n^2 ] by using list concatenation ). After this loop is over, use a separate loop to show the user the two results by printing corresponding  elements from the two lists in the same line, as follows: 1     1 2     4 3     9       …     …  

  • C Programming: Create code that will allow the user to input their initial investment, their monthly...

    C Programming: Create code that will allow the user to input their initial investment, their monthly deposit into their investment, the annual interest rate, and the years to calculate your monthly investment. The table should have three columns: (1) the month (starting at zero), (2) the total amount invested that month, and (3)the present value of your investment with compound interest at the end of that month. (YOU CANNOT USE THE POW FUNCTION) I'm having serious difficulty formulating a loop...

  • Create the following programs in Java {Java1 difficulty} [Please create as simple as possible] a. Ask...

    Create the following programs in Java {Java1 difficulty} [Please create as simple as possible] a. Ask the user to enter their favorite number and favorite word. Pass both of these values to a method that will print the favorite word vertically the favorite number of times. b. Ask the user to enter 2 integers. Pass the integers to 2 different methods: one method to add the integers and print the sum (from the method); the second method to multiply the...

  • Introduction to Java programming You will create a secure password. Ask a user to enter first...

    Introduction to Java programming You will create a secure password. Ask a user to enter first name and last name. (Allow for mixed case) Create a random integer from 10-99. Create the password string that consists of the upper case letter of the last letter of his/her first name, the random number, and the first three letters of his/her last name in lower case. Example someone with the name Rob Lee might have a password that looks like B56lee. Your...

  • Write C code to repeatedly ask the user for a number, then once the user enters...

    Write C code to repeatedly ask the user for a number, then once the user enters 0, the code displays the min, max and average of all values entered. To get proper credit, name the variables as listed below and follow the directions carefully. Do not use any break or similar type of statements. To implement the above code, you will need to count the entries - name the counter variable num_count. You will also need to use a variable,...

  • Display a welcome message and then ask the user to enter his/her name Display a personal...

    Display a welcome message and then ask the user to enter his/her name Display a personal welcome message by addressing the user by his/her name. Declare a constant and assign a number to it as the Conference Room capacity. Ask the user how many people are attending the meeting. Display a meaningful message for each of the three different scenarios. The message informs the user whether he/she can have the requested room and also displays the number of people that...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT