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
mina [271]
4 years ago
11

Write a modular program that finds the equation, area, and circumference of a circle, given the coordinates of the center of the

circle and coordinates of a point on the circle which are entered by the user. Given the coordinates of the center of a circle (Cx, Cy) and the coordinates of a point on the circle (Px, Py) we can find the radius of the circle using the following formula: r= J(Cx - Px)2 + (Cy – Py)? The equation of the circle with radius r and center (Cx, Cy) is: (x – Cx)2 + (y – Cy)2 = y2 Calculate the value of a constant PI (TT) as follows: n = acos(-1) Your program must utilize at least four meaningful called functions that you define. One of the functions will get the coordinates of the center of the circle and the coordinates of a point on the circle and place them in variables defined in main by reference. Also you must use functions to calculate and return the area and circumference of a circle. These functions must be prototyped as follows (you may include the parameter name, but the argument and return type must not be changed): double findArea (double); double findCircum (double); Please note, the final versions of findArea and findCircum do NOT print anything. Don't forget that the definitions of functions (not the prototypes, the definitions) must be preceded by a comment that describes what the function does, the arguments or other inputs it gets (from the user) and the value it returns (if any) or other outputs it produces (displays on the screen). Sample output of a program that satisfies the requirements is shown below. Try to make your output look as much like this as possible. The default precision was used in the sample. The data entered by the user is in blue. Sample Output 1: Enter the x and y coordinates of the center of the circle separated by a comma: 2,5 Enter the x and y coordinates of a point on the circle separated by a comma: 6,2 A circle centered at (2, 5) passing through a point (6, 2) has the equation: (x - 2)^2 + (y – 5)^2 = 25 The circle has an area of 78.5398 square units. The circle has a circumference of 31.4159 units.
Engineering
1 answer:
Semenov [28]4 years ago
3 0

Answer:

Explanation:

#include <bits/stdc++.h>

#include <iostream>

#include <string>

#include <cmath>

using namespace std;

//this function reads the cooridnates of Center from the user

//parameteres are pointer variables of Cx,Cy

//it does not return anything and stores coordinates at given addresses of Cx,Cy

void readCenter(int *Cx,int *Cy)

{

string cooridnates;

cout << "Enter the x and y cooridnates of the centre of the circle separated by comma: " ;

getline(cin,cooridnates);//reading inputs

//convering string ot integer

string x = cooridnates.substr(0, cooridnates.find(","));

string y = cooridnates.substr(cooridnates.find(",")+1);

*Cx=stoi(x);

*Cy=stoi(y);

}

//this function reads the cooridnates of Point from the user

//parameteres are pointer variables of Px,Py

//it does not return anything and stores coordinates at given addresses of Px,Py

void readPoint(int *Px,int *Py)

{

string cooridnates;

cout << "Enter the x and y cooridnates of a point on the circle separated by comma: " ;

getline(cin,cooridnates);//reading inputs

//convering string ot integer

string x = cooridnates.substr(0, cooridnates.find(","));

string y = cooridnates.substr(cooridnates.find(",")+1);

*Px=stoi(x);

*Py=stoi(y);

}

double findArea(double radius)

{

double pi=acos(-1);

return pi*pow(radius,2);

}

double findCircum(double radius)

{

double pi=acos(-1);

return 2*pi*radius;

}

int main()

{

int Cx,Cy;

int Px,Py;

readCenter(&Px,&Py);

readPoint(&Cx,&Cy);

double radius=sqrt(pow((Px-Cx),2)+pow((Py-Cy),2));

cout<<"The circle has an area of "<<findArea(radius)<<" sqaure units\n";

cout<<"The circle has a Circumference of "<<findCircum(radius)<<" units";

return 0;

}

You might be interested in
Technician a says that if a tapered roller bearing is adjusted to loose
Effectus [21]
The technician is true
5 0
3 years ago
To put out a class D metal fire, you must _______ the fire.
gladu [14]

To put out a class D metal fire, you must smother the fire and eliminate the oxygen element in the fire.

<h3>What is a Class D fire?</h3>

A class D fire is a type of fire that cannot be extinguished by water. This is because adding water to it reacts with other elements in the fire intensifying the fire even more.

Smothering in this context involves adding a solution like carbon dioxide (CO2) into the fire, this results in a reduction of oxygen in the atmosphere surrounding the class D fire.

By so doing, smothering the fire eliminates the oxygen element in the fire, thereby extinguishing the fire.

You can learn more about extinguishing fires here https://brainly.in/question/760550

#SPJ1

7 0
2 years ago
In a home, air infiltrates from the outside through cracks around doors and windows. Consider a residence where the total length
masya89 [10]

Answer:

Time period  = 41654.08 s

Explanation:

Given data:

Internal volume is 210 m^3

Rate of air infiltration  9.4 \times 10^{-5} kg/s

length of cracks 62 m

air density = 1.186 kg/m^3

Total rate of air infiltration = 9.4\times 10^{-5} \times 62 = 582.8\times 10{-5} kg/s

total volume of air  infiltration= \frac{582.8\times 10{-5}}{1.156} = 5.04\times 10^{-3} m^3/s

Time period = \frac{210}{5.04\times 10^{-3}} = 41654.08 s

3 0
4 years ago
You want to plate a steel part having a surface area of 160 with a 0.002--thick layer of lead. The atomic mass of lead is 207.19
Pepsi [2]

Answer:

<u><em>To answer this question we assumed that the area units and the thickness units are given in inches.</em></u>

The number of atoms of lead required is 1.73x10²³.    

Explanation:

To find the number of atoms of lead we need to find first the volume of the plate:

V = A*t

<u>Where</u>:

A: is the surface area = 160

t: is the thickness = 0.002

<u><em>Assuming that the units given above are in inches we proceed to calculate the volume: </em></u>

V = A*t = 160 in^{2}*0.002 in = 0.32 in^{3}*(\frac{2.54 cm}{1 in})^{3} = 5.24 cm^{3}    

Now, using the density we can find the mass:

m = d*V = 11.36 g/cm^{3}*5.24 cm^{3} = 59.5 g

Finally, with the Avogadros number (N_{A}) and with the atomic mass (A) we can find the number of atoms (N):

N = \frac{m*N_{A}}{A} = \frac{59.5 g*6.022 \cdot 10^{23} atoms/mol}{207.19 g/mol} = 1.73 \cdot 10^{23} atoms    

Hence, the number of atoms of lead required is 1.73x10²³.

I hope it helps you!

3 0
3 years ago
What the answer fast
anygoal [31]
Viscosity isT=u(U/y) where T is shear stress & u is velocity and y is thr length
The answer is =2.57
7 0
3 years ago
Other questions:
  • When a mesh in a circuit contains an independent or dependent current source, this leads to a special case of mesh-current analy
    14·1 answer
  • A closed system undergoes a process in which work is done on the system and the heat transfer Q occurs only at temperature Tb. F
    8·1 answer
  • Very thin films are usually deposited under vacuum conditions to prevent contamination and ensure that atoms can fly directly fr
    14·1 answer
  • The Review_c object has a lookup relationship up to the Job_Application_c object. The job_Application_c object has a master-deta
    7·1 answer
  • An AX ceramic compound has the rock salt crystal structure. If the radii of the A and X ions are 0.137 and 0.241 nm, respectivel
    10·1 answer
  • The costs of mining and transporting coal are roughly independent of the heating value of the coal. Consider:
    15·1 answer
  • Please Help !!
    5·1 answer
  • What is one major life lesson you learned from the movie; ¨Spare Parts¨
    6·2 answers
  • What setting do i dry my jordan max arua 2s on in the dryer <br>will mark brainliest
    8·1 answer
  • I need help with this question
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!