menu
Qammunity
Login
Register
My account
Edit my Profile
Private messages
My favorites
Ask a Question
Questions
Unanswered
Tags
Categories
Ask a Question
Create a process that will calculate the series 1 + x + x2 + x3 + x4 .......... + xn where x is a floating point number and n is a positive number. you process should be designed so exponentiation (or
asked
Jan 16, 2018
180k
views
2
votes
Create a process that will calculate the series 1 + x + x2 + x3 + x4 .......... + xn where x is a floating point number and n is a positive number. you process should be designed so exponentiation (or the pow function in c++) is not needed.
Mathematics
college
StrayPointer
asked
by
StrayPointer
8.3k
points
answer
comment
share this
share
0 Comments
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
1
Answer
5
votes
Assumptions
1. n is an integer.
2. Language is c++
double expr(double x, int n)
{
double sum = 0.0;
double power = 1.0; // Will have the value x^y where y ranges from 0 to n
int i;
for(i=0; i <= n; ++i) {
sum += power;
power *= x;
}
return sum;
}
KJAWolf
answered
Jan 21, 2018
by
KJAWolf
8.3k
points
ask related question
comment
share this
0 Comments
Please
log in
or
register
to add a comment.
← Prev Question
Next Question →
Related questions
asked
Apr 26, 2024
69.9k
views
An iterative formula is shown below. Xn+1 = 2xn Starting with x₁ = 4, calculate the values of x2, X3 and x4.
Dima Kornilov
asked
Apr 26, 2024
by
Dima Kornilov
7.4k
points
Mathematics
high-school
1
answer
0
votes
69.9k
views
asked
Dec 20, 2020
103k
views
Find the smallest integer n for an O(xn) estimate of order of the function f(x) f(x) = (x3+ x2 + 5)(x4 - 3x2)/[(2x2 + 2x - 3)(4x2 + 7)];
Jobs
asked
Dec 20, 2020
by
Jobs
7.4k
points
Mathematics
college
1
answer
2
votes
103k
views
asked
Jul 4, 2024
167k
views
Solve for x: 2^(3x + 1) - 9 * 2^x + 20 = 0 This equation involves exponentiation and algebraic manipulation. See if you can find the value of x that satisfies the equation. If you'd like, I can provide
Navin Gelot
asked
Jul 4, 2024
by
Navin Gelot
8.7k
points
Mathematics
college
2
answers
2
votes
167k
views
Ask a Question
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.
9.4m
questions
12.2m
answers
Other Questions
How do you estimate of 4 5/8 X 1/3
A bathtub is being filled with water. After 3 minutes 4/5 of the tub is full. Assuming the rate is constant, how much longer will it take to fill the tub?
i have a field 60m long and 110 wide going to be paved i ordered 660000000cm cubed of cement how thick must the cement be to cover field
Write words to match the expression. 24- ( 6+3)
A dealer sells a certain type of chair and a table for $40. He also sells the same sort of table and a desk for $83 or a chair and a desk for $77. Find the price of a chair, table, and of a desk.
Twitter
WhatsApp
Facebook
Reddit
LinkedIn
Email
Link Copied!
Copy
Search Qammunity