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]
3 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]3 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
What is the composition, in atom percent, of an alloy that consists of 4.5 wt% Pb and 95.5 wt% Sn?
jeka57 [31]

Answer: Option A is correct -- 2.6 at% Pb and 97.4 at% Sn.

Explanation:

Option A is the only correct option -- 2.6 at% Pb and 97.4 at% Sn. While option B, which is 7.6 at% Pb and 92.4 at% Sn. and option C, which is 97.4 at% Pb and 2.6 at% Sn. and option D, which is 92.4 at% Pb and 7.6 at% Sn. are wrong.

6 0
3 years ago
Easy POINTS computer genius help me plz
Norma-Jean [14]

Answer:

dedededededede

Explanation:

4 0
3 years ago
The proposed grading at a project site will consist of 25,100 m3 of cut and 23,300 m3 of fill and will be a balanced earthwork j
Anna [14]

Answer:

the volume of water that will be required to bring these soils to the optimum moisture content is 1859 kL

Explanation:

Given that;

volume of cut = 25,100 m³

Volume of dry soil fill = 23,300 m³

Weight of the soil will be;

⇒ 93% × 18.3 kN/m³ × 23,300 m³

= 0.93 × 426390 kN 3

= 396,542.7 kN  

Optimum moisture content = 12.9 %

Required amount of moisture = (12.9 - 8.3)% = 4.6 %

So,

Weight of water required = 4.6% × 396,542.7 = 18241 kN

Volume of water required = 18241 / 9.81 = 1859 m³

Volume of water required = 1859 kL

Therefore, the volume of water that will be required to bring these soils to the optimum moisture content is 1859 kL

6 0
3 years ago
Railroad tracks made of 1025 steel are to be laid during the time of year when the temperature averages 4C (40F). Of a joint spa
DENIUS [597]

Answer:

41.5° C

Explanation:

Given data :

1025 steel

Temperature = 4°C

allowed joint space = 5.4 mm

length of rails = 11.9 m

<u>Determine the highest possible temperature </u>

coefficient of thermal expansion ( ∝ ) = 12.1 * 10^-6 /°C

Applying thermal strain ( Δl / l )  = ∝ * ΔT

                                    ( 5.4 * 10^-3 / 11.9 )  = 12.1 * 10^-6 * ( T2 - 4 )

∴  ( T2 - 4 ) =  ( 5.4 * 10^-3 / 11.9 ) / 12.1 * 10^-6

hence : T2 = 41.5°C

8 0
3 years ago
Two flat plates, separated by a space of 4 mm, are moving relative to each other at a velocity of 5 m/sec. The space between the
xenn [34]

Answer:

0.008

Explanation:

From the question, the parameters given are:

Velocity V = 5 m/s

Pressure = 10 pa

But pressure = F/A

10 = F/A

F = 10A

Substitute all the parameters into the formula below

Coefficient of viscosity (η) = F × r /[AV]

Where

F = tangential force,

r = distance between layers,

A = Area, and

V = velocity

(η) = 10A × 0.004 /[A × 5]

The A will cancel out

(η) = 10 × 0.004 /[5]

(η) = 0.04 /5

(η) = 0.008

Therefore, the coefficient of viscosity of the fluid is 0.008

5 0
3 years ago
Other questions:
  • A horizontal 2-m-diameter conduit is half filled with a liquid (SG=1.6 ) and is capped at both ends with plane vertical surfaces
    11·1 answer
  • A jetliner flying at an altitude of 10,000 m has a Mach number of 0.5. If the jetliner has to drop down to 1000 m but still main
    11·1 answer
  • Two infinite extent current sheets exist at z = −3.0 m and at z = +3.0 m. The top sheet has a uniform current
    11·1 answer
  • 3–102 One of the common procedures in fitness programs is to determine the fat-to-muscle ratio of the body. This is based on the
    5·1 answer
  • How to build a laser pointer?
    12·1 answer
  • The amount of time an activity can be delayed and yet not delay the project is termed:_________
    14·1 answer
  • Air at 300 K and 100 kPa steadily flows into a hair dryer having electrical work input of 1500 W. Because of the size of the air
    6·2 answers
  • Plot da(t) if the output voltage of the converter pole-a is vaN(t)=Vd/2+0.85 Vd/2 sin(Ï1t), where Ï1=2Ï x 60 rad/s
    12·1 answer
  • The difference between an initial condition and a boundary condition for conduction in a solid is:___________
    9·1 answer
  • Describe the meaning of the different symbols and abbreviations found on the documents that they use
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!