Answer to Question #269343 in HTML/JavaScript Web Application for swsq

Question #269343

out of 2 testcases, only 1 testcase is getting fail where its loged in console as NAN. write a Javascript function to return the final value finalValue with the given appreciation percentage and time period. Input

The first line of input contains a number principal

The second line (optional) of input contains a number time

The third line (optional) of input contains a number apprPercentage

Output

The output should be a single line containing the finalValue

Final Value with Appreciation:The formula to calculate the final value with appreciation is, finalValue = principal * (1 + time * appreciation / 100).

Given principal amount

principal as an input, time period in years time and appreciation percentage apprPercentage as optional inputs, write a Javascript function to return the final value finalValue with the given appreciation percentage and time period. The default values for time and apprPercentage are 2 and 5 respectively.

Input1:

1000

2

3

Expected

1060

input2:

2000

Expected

2200


1
Expert's answer
2021-11-21T04:57:41-0500
const original = console.error

beforeEach(() => {
  console.error = jest.fn()
  console.error('you cant see me')
})

afterEach(() => {
  console.error('you cant see me')
  console.error = original
  console.error('now you can')
})

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS