Question

USE THE PYTHON ONLY write a Python program to compute and print a professional investment report....

USE THE PYTHON ONLY

write a Python program to compute and print a professional investment report. Please reference textbook page 73-76 (Case Study: An Investment Report) for this assignment. You may use the code on page 75-76, but you must modify and revise the code to make it really yours and almost perfect.

You must test your program using the following 3 test cases for their specific data values as specified.   

(1) The complete output of your test case #1 must look as follows: (also like on page 73)

Welcome to the Investment Report Tool of TM   1 ================================================.

Enter the investment amount: 10000.00

Enter the number of years: 5

Enter the rate as a %:   5.00

2 ================================================.

Year   Starting balance    Interest   Ending Balance

      1              10000.00    500.00              10500.00

      2              10500.00    525.00              11025.00

      3              11025.00    551.25              10576.25

      4              11576.25    578.81              12155.06

      5              12155.06    607.75              12762.82

3 =================================================.

Ending Balance: $12762.82

Total Interest Earned: $2762.82

4 =================================================.

Thank you for using the Investing Report Tool of TM

5 =================================================.

(2) The beginning output of your test case #2 must look as follows:

Welcome to the Investment Report Tool of TM

1 ================================================.

Enter the investment amount: 10000.00

Enter the number of years: 5

Enter the rate as a %:   3.00

2 ================================================.

(3) The beginning output of your test case #3 must look as follows:

Welcome to the Investment Report Tool of TM

1 ================================================.

Enter the investment amount: 10000.00

Enter the number of years: 5

Enter the rate as a %: 1.50

2 ================================================.

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

CODE IN PYTHON:

print("Welcome to the Investment Report Tool of TM   1")
print("========================================================================.")
investmentAmount = float(input("Enter the investment amount : "))
years = int(input("Enter the number of years : "))
rate = float(input("Enter the rate as %: "))
print("========================================================================.")
print("Year Starting balance  Interest  Ending Balance")
startingBalance = investmentAmount
endingBalance = startingBalance
totalInterest = 0
interest = 0
for i in range(1, years+1):
    interest = startingBalance * rate / 100
    totalInterest += interest
    endingBalance = startingBalance + interest
    print("{0} \t{1:.2f} \t\t\t {2:.2f} \t {3:.2f}".format(i, startingBalance, interest, endingBalance))
    startingBalance = endingBalance
print("Ending Balance : ${0:.2f}".format(endingBalance))
print("Total Interest Earned : ${0:.2f}".format(totalInterest))
print("========================================================================.")
print("Thank you for using the Investing Report Tool of TM")
print("========================================================================.")


INDENTATION:

OUTPUT:

Add a comment
Know the answer?
Add Answer to:
USE THE PYTHON ONLY write a Python program to compute and print a professional investment report....
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
  • USE PYTHON ONLY Please write a Python program to let you or the user play the...

    USE PYTHON ONLY Please write a Python program to let you or the user play the game of rolling 2 dice and win/lose money. Initially, you have 100 dollars in your account, and the dealer also has 100 dollars in his/her account. You would be asked to enter a bet to start the game. If your bet is zero, the game would be stopped immediately. Otherwise, dealer would roll 2 dice and get a number from ( random.randint(1, 6) +...

  • Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. A. Write a...

    Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. A. Write a function named smaller that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display all numbers in the list that are smaller than the number n. Write a code that declares and initializes a list of numbers and a variable number and pass them to the function to test it. Please see the outcome below:...

  • Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. A. Write a...

    Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. A. Write a function named smaller that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display all numbers in the list that are smaller than the number n. Write a code that declares and initializes a list of numbers and a variable number and pass them to the function to test it. Please see the outcome below:...

  • Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a Python...

    Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a Python statement that creates a two-dimensional list named values with 3 rows and 2 columns. Then write nested loops that get an integer value from the user for each element in the list. Then display the content of the list. Please see the outcome below: Outcome run: Enter the 1 element in the 1 row :1 Enter the 2 element in the 1 row :2...

  • Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a Python...

    Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a Python statement that creates a two-dimensional list named values with 3 rows and 2 columns. Then write nested loops that get an integer value from the user for each element in the list. Then display the content of the list. Please see the outcome below: Outcome run: Enter the 1 element in the 1 row :1 Enter the 2 element in the 1 row :2...

  • USE THE PYTHON ONLY Sudoku Game Check Please write a Python program to check a Sudoku...

    USE THE PYTHON ONLY Sudoku Game Check Please write a Python program to check a Sudoku game and show its result in detail. This is an application program of using 2-dimensional arrays or lists. Each array or list is a game board of 9 x 9. Your program must check the 9 x 9 game board, and report all the problems among 9 rows, 9 columns, and 9 squares. As you can see, you must pre-load the following four games...

  • In python, write the following program, high school question, please keep simple. When I submitted the...

    In python, write the following program, high school question, please keep simple. When I submitted the solution, I get an error as 'wrong answer'. Please note below the question and then the solution with compiler errors. 7.2 Code Practice: Question 2 Instructions Write a program to generate passwords. The program should ask the user for a phrase and number, and then create the password based on our special algorithm. The algorithm to create the password is as follows: If the...

  • Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a function...

    Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. Write a function named capital_letter that accepts a string as an argument and checks if each word in the string begins with a capital letter. If so, the function will return true, otherwise, return false. Please see the outcome below: Outcome number 1: Enter a string: Python Is Really Fun! True Sample run number 2: Enter a string: i Love Python False Note: Try to keep this...

  • USING PYTHON. please print screen it working (input and output)! Create a program for the following:...

    USING PYTHON. please print screen it working (input and output)! Create a program for the following: Orlando International Airport is creating an app that allows a passenger to check on the availability of flights in 2020. As a first test, a user may check on flights to either Albany or Austin. To get into the app, the user must enter an account number, which must be between 1500 and 9999. The user should then be asked to enter 1 for...

  • Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. A. Write a...

    Python Language Only!!!! Python Language Only!!!! Python Language Only!!!! Python 3 is used. A. Write a function named smaller that accepts two arguments: a list, and a number n. Assume that the list contains numbers. The function should display all numbers in the list that are smaller than the number n. Write a code that declares and initializes a list of numbers and a variable number and pass them to the function to test it. Please see the outcome below:...

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