Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In this problem, your job is to calculate the final amount (principal plus simple interest) given an amount of money, an annual interest rate, and

In this problem, your job is to calculate the final amount (principal plus simple interest) given an amount of money, an annual interest rate, and the number of years in the interest period.

INPUT:

The input section of the program is already written for you. This description is here to explain what is happening.

The program receives three lines of input:

  • The first will be the principal sum of money earning the interest (float). This is stored in a variable called principalSum.
  • The second will be the simple annual rate as a percentage (float). For example, 10.5 for 10.5% (It is not given as the decimal 0.105). This is stored in a variable called interestRate.
  • The third will be the interest period in years (integer). This is stored in a variable called interestPeriod.

PROCESSING:

Calculate the final amount of money using the formula:

Where:

  • A is the final amount
  • P is the initial principal
  • r is the annual interest rate
  • t is the time in years

Store the final amount to a variable called finalAmount.

OUTPUT:

The output section of the program is already written for you. This description is here to explain what is happening.

Output will be of the form:

Final amount is $131.50

image text in transcribed

The language being used is python

1 Exit Full Screen al-p2.py New 1 ## 2 # CSCI 1503 3 # Assignment 1, Problem 2 4 # Author: James Fleming 5 6- # Input section: 7 principal Sum = float( input) 8 interestRate = float( input()) 9 interestPeriod = int( input) 10 11 - # Process section: 12 13 # Do not change any lines of code above these comment lines. 14 # Write you code for the processing section of the program below 15 # these comment lines. 16 17 18 19 20 21 22 # Do not change any lines of code below these comment lines. 23 # 24 25 - # Output section: 26 print(f'Final amount is ${finalAmount:,.2f}') 27 # #

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Main Memory Database Systems

Authors: Frans Faerber, Alfons Kemper, Per-Åke Alfons

1st Edition

1680833243, 978-1680833249

More Books

Students also viewed these Databases questions