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
Alexxandr [17]
3 years ago
10

Approximation of PI: [50 marks] Write a C program that computes an approximation of pi (the mathematical constant used in many t

rigonometric and calculus applications) to four decimal places. A summation that can be used to compute pi is the following (from calculus).
Engineering
1 answer:
ANTONII [103]3 years ago
4 0

Answer:

#include <iostream>

#include <cmath>

#include <iomanip>

using namespace std;

double piValue() {

       double p = 1;

       int i = 1;

       while(true) {

               double prev = p;

               p += pow(-1, i) * (1.0 / (1 + 2*i));

               if(abs(prev - p) < 0.00005) {

                       break;

               }

               i++;

       }

       return 4*p;

}

int main() {

       cout << piValue() << endl;

}

**************************************************

You might be interested in
Calculate the number of atoms per cubic meter in Metal B (units atoms/m^3). Write your answer with 4 significant figures metal:
Iteru [2.4K]

Answer:

7,217*10^28 atoms/m^3

Explanation:

  • Metal: Vanadium
  • Density: 6.1 g/cm^3
  • Molecuar weight: 50,9 g/mol

The Avogadro's Number, 6,022*10^23, is the number of atoms in one mole of any substance. To calculate the number of atoms in one cubic meter of vanadium we write:

1m^3*(100^3 cm^3/1 m^3)*(6,1 g/1 cm^3)*(1 mol/50,9g)*(6,022*10^23 atoms/1 mol)=7,217*10^28 atoms

Therefore, for vanadium we have 7,217*10^28 atoms/m^3

6 0
3 years ago
What does this work for
Anastaziya [24]

Answer:

it allows your dash board to light up you MPH RPM and all the other numbers on the spadomter

Explanat

8 0
3 years ago
While discussing VIN numbers, Technician A says that the first digit of the VIN identifies the country where the vehicle was man
ruslelena [56]
Usually the first digit of the vin id’s the country it was built. So technician A would be correct. That’s usually how it is. Hope this helps. Please let me know if this is incorrect
4 0
3 years ago
Just to let you know Christmas is in 10 days&lt;3<br><br> lol
Harrizon [31]

Answer:

yay yay

Explanation:

im so excited i cant wait

7 0
3 years ago
Read 2 more answers
A heavy ball with a weight of 150 N is hung from the ceiling of a lecture hall on a 4.0-m-long rope. The ball is pulled to one s
shusha [124]

Answer:

The tension in the rope at the lowest point is 270 N

Explanation:

Given;

weight of the ball, W = 150 N

length of the rope, r = 4 m

velocity of the ball, v = 5.6 m/s

When the ball passes through the lowest point, the tension on the rope is the sum of weight of the ball and centripetal force.

T = W + F

Centripetal force, F = mv²/r

where;

m is the mass of the ball

m = W/g

m = 150 / 9.8 = 15.306 kg

Centripetal force, F = mv²/r

F = (15.306 x 5.6²)/4

F = 120 N

T = W + F

T = 150 + 120

T = 270 N

Therefore, the tension in the rope at the lowest point is 270 N

6 0
3 years ago
Other questions:
  • There are two piston-cylinder systems that each contain 1 kg of an idea gas at a pressure of 300 kPa and temperature of 350 K. T
    8·1 answer
  • The yield strength of mild steel is 150 MPa for an average grain diameter of 0.038 mm ; yield strength is 250 MPa for average gr
    15·1 answer
  • Use the APWA 5600 methodology to compute the 1/25 design discharge for the following catchment. The catchment area consists of 1
    9·1 answer
  • Suppose the Bookstore is processing an input file containing the titles of books in order to remove duplicates from their list.
    8·1 answer
  • 6. Question
    13·1 answer
  • Introduction for site visit​
    13·1 answer
  • Is a compass a analog or a digital sensor?
    14·1 answer
  • In the figure show, what's the distance from point H to point C?
    14·1 answer
  • a storage tank contains liquid with a density of 0.0361 lbs per cubic inch. the height of liquid in the tank is 168 feet. what i
    8·1 answer
  • Algorithm for sum 2+4+6+….+n
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!