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 a radio wave made up of? Molecules? Electrons? Other?
mafiozo [28]

Radio waves are radiated by charged particles when they are accelerated. They are produced artificially by time-varying electric currents, consisting of electrons flowing back and forth in a specially-shaped metal conductor called an antenna. ... Radio waves are received by another antenna attached to a radio receiver.

4 0
3 years ago
Read 2 more answers
To 3 significant digits, what is the temperature of water in degrees C, if its pressure is 350 kPa and the quality is 0.01
liq [111]

Answer:

138.9 °C

Explanation:

The datum of quality is saying to us that liquid water is in equilibrium with steam. Saturated water table gives information about this liquid-vapour equilibrium. In figure attached, it can be seen that at 350 kPa of pressure (or 3.5 bar) equilibrium temperature is 138.9 °C

3 0
3 years ago
Read two numbers from user input. Then, print the sum of those numbers. Hint -- Copy/paste the following code, then just type co
Softa [21]

Answer:

I am Providing Answer in C Language Program.

Explanation:

Please find attachment regarding code of taking two numbers input and adding them.

I would like to recommend you please use software which supports C language.

#include <stdio.h>

int main () {

int a, b, sum;

printf ("\ nEnter two no:");

scanf ("% d% d", & d, & e);

sum1 = d + e;

printf ("Sum:% d", sum1);

return (0);

}

4 0
3 years ago
A TPMS (tire pressure monitoring system) instrument panel indicator lamp is on. Technician A says the most likely cause is low t
zheka24 [161]

Answer:

Actualmente estoy trabajando en una pregunta diferente en este momento.

Explanation:

Actualmente estoy trabajando en una pregunta diferente en este momento.

6 0
3 years ago
The roof of a refrigerated truck compartment consists of a layer of foamed urethane insulation (t2 = 21 mm, ki = 0.026 W/m K) be
lakkis [162]

Answer:

Tso = 28.15°C

Explanation:

given data

t2 = 21 mm

ki = 0.026 W/m K

t1 = 9 mm

kp = 180 W/m K

length of the roof is L = 13 m

net solar radiation into the roof = 107 W/m²

temperature of the inner surface Ts,i = -4°C

air temperature is T[infinity] = 29°C

convective heat transfer coefficient h = 47 W/m² K

solution

As when energy on the outer surface at roof of a refrigerated truck that is balance as

Q = \frac{T \infty - T si }{\frac{1}{hA}+\frac{t1}{AKp}+\frac{t2}{AKi}+\frac{t1}{aKp}}       .....................1

Q = \frac{T \infty - Tso}{\frac{1}{hA}}                         .....................2

now we compare both equation 1 and 2 and put here value

\frac{29-(-4)}{\frac{1}{47}+\frac{2\times0.009}{180}+\frac{0.021}{0.026}} = \frac{29-Tso}{\frac{1}{47}}            

solve it and we get

Tso = 28.153113

so Tso = 28.15°C

3 0
3 years ago
Other questions:
  • An atomic force that can attract or repel ferrous substances is<br> known as:
    14·1 answer
  • What is an ip<br> Number
    12·1 answer
  • 7. The "3 second rule" is the time you should pause at an intersection marked with a stop sign.
    6·1 answer
  • Please help <br>.. <br>....<br> . .<br>....<br>...​
    13·1 answer
  • Suggest how the following requirements might be rewritten in a
    8·1 answer
  • 1) A cylinder has a volume of 20 cubic feet. What is that volume in cubic inches? (1 ft = 12 in) ​
    8·1 answer
  • Describing Tasks for Stationary Engineers Click this link to view O*NET’s Tasks section for Stationary Engineers. Note that comm
    12·2 answers
  • How can statistical analysis of a dataset inform a design process
    11·1 answer
  • I need help with this I dont know the word ​
    10·2 answers
  • 5. Liam is working on a circuit and notices it's quite hot to the touch. What's causing the heat Liam Is noticing
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!