1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kazeer [188]
3 years ago
15

Write a C++ program that computes an approximation of pi (the mathematical constant used in many trigonometric and calculus appl

ications) to four decimal places. A summation that can be used to compute pi is the following (from calculus). pi = 4/1 - 4/3 + 4/5 - 4/7 + 4/9 - ....... + (-1)ⁿ * 4/ (2n+1)Your program will compute a sequence of computations: S₀ = 4/1 S₁ = S₀ - 4/3 S₂ = S₁ + 4/5Since the above sequence So, S1, S2, ... converges to pi, we can stop when two consecutive S values differ by less than 0.00005.
Computers and Technology
1 answer:
Verizon [17]3 years ago
3 0

Answer:

#include <iostream>

#include<cmath>

using namespace std;

int main()

{

double total = 0;

double check=1;

double ct=0;

double old=1;

while( fabs(total - old) > 0.00005 )

{

old=total;

total=total+check*4.0/(2.0*ct+1);

ct=ct+1;

check=0.0-check;

}

cout<<"Approximate value of pi is "<<total<<endl;

return 0;

}

Explanation:

  • Initialize all the necessary variables.
  • Run a while loop until the following condition is met.

fabs(total - old) > 0.00005

  • Inside the while loop calculate the total value.
  • Lastly, display the approximate value of pi.
You might be interested in
1) Which forms are NOT appropriate to use for affirmations in Full Verbatim?
Oliga [24]

NOT appropriate to use for affirmations in Full Verbatim are :

d) Mm

e) Ammm

f) Aha

Explanation:

  • In verbatim transcription, interviews are transcribed word for word, and sound for sound.  Every um, uh, laugh, and sound must be recorded for posterity.

These are the preferred spellings of typical utterances:

  1. Affirmative: uh-huh, mm-hmm, yeah.
  2. Don't use: um-hum, um-hmm, uh-hum

  • Full verbatim refers to a transcript that includes absolutely everything that is said, exactly how the speakers say it. This means we include all ums, uhs, grammatical and vocabulary mistakes, false starts and repetitions - everything.
  • Verbatim is defined as an exact repetition without changing the words. An example of verbatim is when you quote someone exactly without changing anything.
3 0
3 years ago
Steve is creating a document with proper nouns, which Word continues to identify as being misspelled.
mash [69]

Answer:

it's D. B and C are correct.

Explanation:

The options are:

A. Skip the Spell Checker.

B. Right-click the noun and choose to Ignore All.

C. Right-click and Add to the dictionary.

D. B and C are correct.

You can either right-click the noun and choose to Ignore all. or you can Right-click and add to the dictionary. And this is because you are correct this time, as a proper noun can have misspelled type of spelling. And this is because it is some other language word, and that's why.

6 0
3 years ago
Read 2 more answers
Explain how data structures and algorithms are useful to the use of computer in data management<br>​
laiz [17]

Answer:

programmers who are competent  in data  structures and algorithms  can easily perform the tasks related  to data processing ,automated reasoning ,or calculations . data structure and algorithms  is significant  for developers  as it shows their problems solving abilities amongst the prospective employers .

5 0
3 years ago
Which property describes if a mineral breaks down into flatpieces​
marta [7]

Answer: Cleavage

Explanation:

3 0
3 years ago
Why was the television the first audio visual device that changed the way people see entertainment?
Daniel [21]
It was  not.   Movies   then  talking movies  were   before television.

7 0
3 years ago
Other questions:
  • Why will the standard replacement algorithms (LRU, FIFO, clock) not be effective in handling this workload for a page allocation
    11·1 answer
  • A network administrator needs information about the printers that employees can access. Where can he find the information? The a
    10·2 answers
  • With ____________________, you can insert and remove a device while the computer is running.
    11·1 answer
  • Does anyone know what the name of the game is, where you click on the grey dots in a 3x3 grid and try to make them all the same
    10·1 answer
  • What is a disadvantage of shopping online?A.Harder to compare prices than in storesB.A higher risk of financial data theftC.More
    6·2 answers
  • BEING TIMED HELP ASAP
    12·2 answers
  • Space cushion includes
    8·2 answers
  • Nj hj hjkbh hj g7yubuyiycrtdryfrrcctcftt
    12·2 answers
  • Anyone can help me please ?
    7·1 answer
  • C program how to input this? ​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!