ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Разделы > Linear Data Structures: Arrays > задача:


Question 1

Задачи раздела

• 51107 - Factorial
• ECE - Question 1
• CEN - Question 1
• Reflektimi i pikes
• 50972 - Division
• 51135 - Class Average 1
• 51136 - Class Average 2
• 51094 - Passing the course
• Question 1
• 51069 - Last Digit of a Fibonacci Nu...
• 51130 - Permutation of Everything
• 51073 - Campus Tours for High Sch...
• 50994 - The Most Crowded Station
• 51148 - Circles
• 51123 - Mr. Li Criteria
• 51124 - Easy Tiae words
• 51145 - Graduation Exam

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
bfs.

Simple interest

Question: You deposit $PV in a bank account that pays simple interest rate of r%. 

Bank applies different interest rates according to the time.

  • If time is less than 1 year: interest rate =0.0%
  • If time is between 1 and 3 years(both included): interest rate =5.7%
  • If time is greater than 3 years: interest rate =12.6%

Simple interest is calculating using this formula:

FV=PV*(1+r*t)

Where:

  • FV is future value, total Accrued Amount (principal + interest)
  • PV is the present value (principal amount).
  • r is the interest rate.
  • t is the time involved.

How much will you have in your account after t years?

Input specification: You will be given two inputs. Principal amount 0.0<PV<=5000000.00, and the time 0.1<=t<=15.0

Output specification: Show your account's amount as floating point number with two digits precision.

Sample Input I
1000.00 0.5
Sample Input II
25789.50 2.5
Sample Output I
1000
Sample Output II
29464.50

Sample Input II Explanation: Because time (t) is between 1 and 3 the rate interest is calculated as 5.7%. Using simple interest formula we calculate FV:

FV=PV*(1+r*t) = 25789.50*(1+ (0.057*2.5) = 25789.50*1.1425=29464.50375

FV=29464.50

 
Для отправки решений необходимо выполнить вход.

www.contester.ru