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 compound interest) given an amount of money, an annual interest rate, number

In this problem, your job is to calculate the final amount (principal plus compound interest) given an amount of money, an annual interest rate, number of times per year interest is applied, and the number of years that have elapsed.

INPUT:

Using the input sections from Problems 1 and 2 as examples, write your own input section to input values the following:

  • The first will be the principal sum (float). Store it in a variable called principalSum.
  • The second will be the annual interest rate as a percentage (float). For example, 10.5 for 10.5% (It is not given as the decimal 0.105). Store it in a variable called interestRate.
  • The third will be the number of times per year interest is applied (integer). Store it in a variable called timesPerYear.
  • The fourth will be the number of years that have elapsed (integer). Store it in a variable called numberOfYears.

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
  • n is the number of times per year interest is applied
  • t is the time in years

Store the final amount to a variable called finalAmount.

OUTPUT:

Using the output section of Problem 2 as an example, write your own output section to print the following:

The final amount on $100.00 at 10.500% applied 1 times a year for 3 years is $134.92.

given 100.00 as the principal sum, 10.5 as the interest rate, applied once a year for 3 years.

NOTE: The principal should always have 2 decimal places, and the interest 3 decimals places

image text in transcribed

The language being used is python

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('Final amount is ${final Amount:,.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_2

Step: 3

blur-text-image_3

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions