Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. Compound Interest Formula Please write Python code to implement the following compound interest formula and solve the problem below. A = P(1 +

4. Compound Interest Formula Please write Python code to implement the following compound interest formula Data Types int integer integer float floating subtraction point multiplication True or False to the power of

4. Compound Interest Formula Please write Python code to implement the following compound interest formula and solve the problem below. A = P(1 + -)nt n A P = final amount initial principal balance r = interest rate n = number of times interest applied per time period t = number of time periods elapsed 4a) Bank A offers a 5% interest compounded semi-annually (n=2). A customer deposits HKD$1600 on 1st January of a year. At the end of the year, the amount he would have gained by way of interest is: Implement the compound interest formula with the following variables: P = 1680; r = 5/199; n = 2; t=1 Expected output: The interest gained is $81.0 Data Types int integer integer float floating subtraction point multiplication True or False to the power of division // floor division 18 mod bool str [...] list string Math Functions / Conversion abs () input () print () round () type () int() Arithmetic Operators List /String Operations list [...] list[:] Float () str() absolute value 1+ ask user for input display the input value(s) in not in list.sort () list.append() list.pop() remove and return an item at a specific index list.count() count the occurrence of the input item list.index() find the index of the input item len () max() min() sum () round off the input value range (...) return data type of input range (...) convert input to integer convert input to float convert input to string locate item(s) in a list combine two lists/ strings check existence in a list / string check if not exists in a list / string add a new element in the list sort the input list return the number of elements in input list find the biggest element in the input list find the smallest element in the input list find the sum of all elements of the input list create a list of integer Relational Operations is equal? k is less than? K= is less than or equal to? != is not equal? is greater than? is greater than or equal to? Boolean Operators and are both operands True? is/are either (or both) of the operands True? not is the operand False? or Conditional Statement if : elif : else : Loop (for) for svar> in

Step by Step Solution

There are 3 Steps involved in it

Step: 1

SOLUTION Heres the Python code that implements the compoun... 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

Income Tax Fundamentals 2013

Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill

31st Edition

1111972516, 978-1285586618, 1285586611, 978-1285613109, 978-1111972516

More Books

Students also viewed these Banking questions