Touchdevelop- prompt for the accuracy value

Assignment Help Computer Engineering
Reference no: EM13753196

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! + ...

Values 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.

Create a 2nd loop the sum s until the sequential term is less than accuracy. Prompt for the accuracy value. Test for accuracy 0.01, 0.001 and 0.0001. Provide a flowchart.

screenshots of at least four (4) sets of sample inputs (test cases). This time a flowchart is treated.

Reference no: EM13753196

Questions Cloud

Internet security and network neutrality : Compose an executive summary highlighting the paper's contents and reasoning for your chosen topic. Internet Security and Network Neutrality
Complexities of the us financial system : The U.S. financial system has many complexities, and it is impacted by several environmental factors, including federal regulations and the economy.
Analysis of operating activities : Explain the concepts of income measurement and their implications for analysis of operating activities Describe ways to analyze revenue and expense recognition and discuss possible risks for financial analysis
Businesses to engage in international business : 8. Create 3 businesses to engage in international business with your country. The first business should be an example of trade: describe a new, foreign firm in your country that is based on exporting or importing. The next 2 businesses should be exam..
Touchdevelop- prompt for the accuracy value : Create a 2nd loop the sum s until the sequential term is less than accuracy. Prompt for the accuracy value. Test for accuracy 0.01, 0.001 and 0.0001. Provide a flowchart.
Write paper on using quality control tools : Prepare a 3-page APA formatted paper on using quality control tools.
Compare john locke and rousseaus view of social contract : Compare and Contrast John Locke and Rousseau's views of the state of nature and the nature of the social contract. Which elements of human nature does each author stress?
Double-declining balance method : A machine which cost $300,000 is acquired on October 1, 2014. Its estimated salvage value is $30,000 and its expected life is 8 years. Calculate depreciation expense for 2014 and 2015 by the double-declining balance method. Show all figures used and ..
Describe what action the organization should take : Mark works for the Wonder Mattress Company in the IS department. He is in charge of looking at new technologies that come on the market and determining if they can be used for the company. A recommendation of what action the organization should tak..

Reviews

Write a Review

Computer Engineering Questions & Answers

  Investigating a social engineering attack

Investigate a social engineering attack describing what has made this attack more successful and the information which was observed from this attack is sure to involve how could this attack be avoided.

  Create a program that asks the user for the number of month

Create a program that asks the user for the number of a month, then creates the array F of (n+1) Fibonacci numbers, and prints the sequence.

  What are the advantages of modular programming in rts

What are the advantages of modular programming in RTS and can all the tasks  meet their respective deadlines when priority ceiling protocol is used for resource scheduling?

  Write a 1150- to 1350-word paper in which you discuss and

write a 1150- to 1350-word paper in which you discuss and explain the interrelationship of prohibition and the rise

  Can you show what the eight-hex-digit address is

Suppose that you have a 32-bit PC with 512 MB of RAM. What is the eight-hex-digit address of the "last" byte of installed memory?

  Design a class named productionworker

The workday is divided into two shifts: day and night. The shift field will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. make the appropriate accessor and mutator met..

  Design a class for services offered by a hair-styling salon

The Curl Up and Dye Salon offers a variety of salon services for its customers. Jane Fields, owner, has contracted to have you write a program that allows reports to be output, sorted by each kind of service offered. Table below shows the various ..

  Vulnerabilities in purchasing through debit card

Recognize any potential vulnerabilities in act of making a purchase through the debit card, and which area of the CIA triad they apply to.

  Explain a mitigating strategy for the risks

Briefly identify and describe a mitigating strategy for the risks.

  How to use ms access and create a database

How to use MS Access and create a database

  Questioninternet protocol standards are devised throughout

questioninternet protocol standards are devised throughout the efforts of thousands of people all over the world --

  Identify the key words in the above problem statement and

diagram the following arguments using structure diagram.the problem is with the power supply. the reason being the

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd