TouchDevelop homwork
Write a mobile app (using TouchDevelop) that calculates
the sum (which computes e×) of n + 1 terms as
sum = 1 + x/ 1! + /2! + / 3! + /4! + …
Save your time - order a paper!
Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines
Order Paper NowValues x and n should be read (prompted to enter). Calculate each sequential term base on the previous one to get the best calculation performance (so, the next one = the previous term * (x / i) where i the current control variable – index). Don’t use the math function. Use only one loop. The output should be in the table format as follows (remember to use the reverse wall order shown in class):
x = ?, n = ?
iteration # termValue sum
…
Example:
x = 1, n = 2
iteration # termValue sum
1 1 2
2 0.5 2.5
e× = 2.71828…, where x = 1
Each row corresponds to values in each iteration except the last row which should give the final result in the text box (see p.38 ch3 of our text [3] and also the last exercise in class). A very last line of the output should give the return value of e× from the formula exp(x : Number) : Number (see p.186 of our text).
Test for x = 1, n = 5 and n = 10 – the expected result should be better for n = 10 and you will expect the sum around 2.71828…. Next test for x = 2, n = 5, and n = 10.
Computer Science homework help