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
A corporate or government network that uses Internet tools, such as Web browsers, and
Alchen [17]

Answer: Intranet

Explanation:

The options include:

A. extranet.

B) social network.

C) intranet.

D) e-market.

A corporate or government network that uses Internet tools, such as Web browsers, and Internet protocols is referred to as intranet.

Social networks are social media sites that are used by people which allows them to stay connected with one another.

E-market is a form of marketing whereby goods and services are promoted or advertised through the use of the internet.

Therefore, the answer to he above question is intranet.

3 0
3 years ago
Pls help ...
dedylja [7]

Answer:

  • You open the class, and print sleep after thread 3000
  • So A
8 0
3 years ago
An image can be copied from the Internet or another location and pasted into Paint.
Furkat [3]
It is true. You can copy and paste a picture into microsoft paint, using either the right click task bar or Ctrl c-ctrl v, you can then adjust the image to the desired size.
5 0
3 years ago
Review universal data models and discuss how these are being used more widely today. Does a data modeling project using a packag
adell [148]

Answer:

2. A data modelling project using a packaged data model REQUIRES A GREATER SKILL than a project not using a packaged data model.

Explanation:

1a. Review of universal models:

A data model is an abstract model that organizes elements of data and standardizes how they relate to one another and to the properties of real world entities. It has become the standard approach used towards designing databases.

A universal data model is a template data model that can be reused as a starting point or a building block to jump-start development of a data modelling project, industry specific model, logical data models.

1b. Discuss how these are being used more widely today.

*Universal data models helps professional reduce development time, improve consistency and standardization while achieving high quality models.

*Higher quality: just as architects consider blue prints before constructing a building, one should also consider data before building an app. A data model helps define the problem, enabling one to consider different approaches and choose best ones.

*By properly modelling and organization's data, the database designer can eliminate data redundancies (needless repetitions) which are a key source for inaccurate information and ineffective systems.

2. Greater and advanced skills are adequate and required when data modelling project is done using packaged data model while fewer skills are required when data modelling is done without packaged data model.

7 0
3 years ago
Read 2 more answers
If you are interested in joining the military, you can attend college _____. a. before serving b. during service c. after servic
Arturiano [62]

D .All the above.

Explanation:while in the military you can take online courses during service or you can can choose to do it before or after

6 0
3 years ago
Other questions:
  • Help please?
    10·1 answer
  • When the increment or decrement operator is placed before the operand (or to the operand's left), the operator is being used in
    6·1 answer
  • Select the correct answer. Larry finds it easy to run legacy programs and applications in a virtualized environment. How does th
    5·1 answer
  • How many much memory is in one megabyte ?
    9·1 answer
  • Write pseudocode to represent the logic of a program that allows a user to enter three values then outputs the product of the th
    8·1 answer
  • Which external reference is formatted correctly?
    6·2 answers
  • A programmer wants to determine whether a score is within 10 points of a given target. For example, if the target is 50, then th
    11·1 answer
  • Write an algorithm to print the odd number from 100 to 1​
    13·1 answer
  • If two devices simultaneously transmit data on an Ethernet network and a collision occurs, what does each station do in an attem
    8·1 answer
  • To read encrypted data, the recipient must decipher it into a readable form. What is the term for this process?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!