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
Convert 25 mm into in.
mihalych1998 [28]

Answer:

25 mm = 0.984252 inches

Explanation:

Millimeter and inches are both units of distance. The conversion of millimeter into inches is shown below:

<u>1 mm = 1/25.4 inches</u>

From the question, we have to convert 25 mm into inches

Thus,

<u>25 mm = (1/25.4)*25 inches</u>

So,

25 mm=\frac{25}{25.4} inches

Thus, solving we get:

<u>25 mm = 0.984252 inches</u>

4 0
3 years ago
the increase of current when 15 V is applied to 10000ohm rheostat which is adjusted to 1000ohm value​
Anastasy [175]
Given data:
•) applied voltage = 15 V
•). Resistance = 1000 ohm

Required:
•). The magnitude of current= ?

•••••••••••••SOLUTION•••••••••••••

We can find the relation ship between current, voltage and resistance with the help of Ohms law.

According to ohms law;

V= IR.

Rearranging the above equation;

I= V/ R

Putt the values in the above equation; we get

I= 15V/ 1000ohm

I = 0.015 A( ampere)

••••••••••••••• CONCLUSION•••••••

The value of the current would be 0.15 ampere when Resistance is equal to 1000 and that of Voltage is equal to 15 V.
4 0
3 years ago
A sheet of steel 3-mm thick has nitrogen atomospheres on both sides at 900 C and is permitted to achieve a steady-state di usion
kati45 [8]

Answer:

X_B = 1.8 \times 10^{-3} m = 1.8 mm

Explanation:

Given data:

Diffusion constant for nitrogen is = 1.85\times 10^{-10} m^2/s

Diffusion flux = 1.0\times 10^{-7} kg/m^2-s

concentration of nitrogen at high presuure = 2 kg/m^3

location on which nitrogen  concentration is 0.5 kg/m^3   ......?

from fick's first law

J = D \frac{C_A C_B}{X_A X_B}

Take C_A as point  on which nitrogen concentration is 2 kg/m^3

x_B = X_A + D\frac{C_A -C_B}{J}

Assume X_A is zero at the surface

X_B = 0 + ( 12\times 10^{-11} ) \frac{2-0.5}{1\times 10^{-7}}

X_B = 1.8 \times 10^{-3} m = 1.8 mm

4 0
3 years ago
Plz solve the problem
julsineya [31]
I attached a photo that explains and gives the answer to your questions. Had to add a border because the whole picture didn’t fit.

6 0
3 years ago
A cold air standard gas turbine engine with a thermal efficiency of 56.9 % has a minimum pressure of 100 kP
Aleks04 [339]

Answer:

a) 5.2 kPa

b) 49.3%

Explanation:

Given data:

Thermal efficiency ( л ) = 56.9% = 0.569

minimum pressure ( P1 ) = 100 kpa

<u>a) Determine the pressure at inlet to expansion process</u>

P2 = ?

r = 1.4

efficiency = 1 - [ 1 / (rp)\frac{r-1}{r} ]

   0.569   = 1 - [ 1 / (rp)^0.4/1.4

1 - 0.569  = 1 / (rp)^0.285

∴ (rp)^0.285 = 0.431

rp = 0.0522

note : rp = P2 / P1

therefore P2 = rp * P1 = 0.0522 * 100 kpa

                                   = 5.2 kPa  

b) Thermal efficiency

Л = 1 - [ 1 / ( 10.9 )^0.285 ]

   = 0.493 = 49.3%

4 0
3 years ago
Other questions:
  • When the outside temperature is 5.2 ⁰C, a steel beam of cross-sectional area 52 cm2 is installed in a building with the ends of
    8·1 answer
  • The outer surface of a spacecraft in space has an emissivity of 0.6 and an absorptivity of 0.2 for solar radiation. If solar rad
    12·1 answer
  • Estimate the time it would take for such axons to carry a message from a foot stepping on a sharp object to the brain and then b
    14·1 answer
  • Two loads connected in parallel draw a total of 2.4 kW at 0.8 pf lagging from a 120-V rms, 60-Hz line. One load absorbs 1.5 kW a
    5·1 answer
  • Heating of Oil by Air. A flow of 2200 lbm/h of hydrocarbon oil at 100°F enters a heat exchanger, where it is heated to 150°F by
    7·1 answer
  • What do you do if building doesn't have enough water pressure for sprinklers? a. Increase pipe size b. Adjust budget to accommod
    15·1 answer
  • HELP ME PLEASE RN
    8·1 answer
  • Work to be performed can come from the work package level of the work breakdown structure as well as other sources. Which of the
    11·1 answer
  • When mass is the same, what is the relationship between radius and compression strength?
    5·1 answer
  • Explain your own understanding about the relevant connections between the four subsystems of Earth through the use of a creative
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!