Just another sequence, f(x) = x - x^3/3! + x^5/5! - x^7/7! + Input x and the number of terms used in the sequence, output the result. Note: x^1 = x, x^2 = x*x, x^3 = x*x*x 3! = 1*2*3 5!=1*2*3*4*5 Flowchart and code this solution. Prompt Calculate a series Input x and the number of terms, output f(x) Input 11 Output 1.000000 f(x)=x-x^3/3!+x^5/5!-x^7/7!+. Input x and the number of terms, output f(x) 12 Output 0.833333

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 20PE
icon
Related questions
Question

I would like assistance on writing a C++ program for this problem, without using double. Thank you

Just another sequence,
f(x) = x - x^3/3! + x^5/5! - x^7/7! +
Input x and the number of terms used in the sequence, output the result.
Note: x^1 = x, x^2 = x*x, x^3 = x*x*x
3! = 1*2*3 5!=1*2*3*4*5
Flowchart and code this solution.
Prompt
Calculate a series
Input x and the number of terms, output f(x)
Input
11
Output
1.000000
f(x)=x-x^3/3!+x^5/5!-x^7/7!+.....
Input x and the number of terms, output f(x)
12
Output
0.833333
Transcribed Image Text:Just another sequence, f(x) = x - x^3/3! + x^5/5! - x^7/7! + Input x and the number of terms used in the sequence, output the result. Note: x^1 = x, x^2 = x*x, x^3 = x*x*x 3! = 1*2*3 5!=1*2*3*4*5 Flowchart and code this solution. Prompt Calculate a series Input x and the number of terms, output f(x) Input 11 Output 1.000000 f(x)=x-x^3/3!+x^5/5!-x^7/7!+..... Input x and the number of terms, output f(x) 12 Output 0.833333
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Unary Predicate
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning