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
A _____ satellite system employs many satellites that are spaced so that, from any point on the Earth at any time, at least one
Wittaler [7]

Answer:

d. low earth orbit (LEO)

Explanation:

This type of satellites form a constellation deployed as a series of “necklaces” in such a way that at any time, at least one satellite is visible by a receiver antenna, compensating the movement due to the earth rotation.

Opposite to that, a geostationary satellite is at an altitude that makes it  like a fixed point over the Earth´s equator, rotating synchronously with the Earth, so it is always visible in a given area.

3 0
3 years ago
Which of the following describes how the author introduces dust storms in the text??​
Oduvanchick [21]

Answer:

B-as deadly storms that claim lives in th great pines

Explanation:

I hope it helped if it did pls make me brainliest

8 0
3 years ago
Read 2 more answers
Find the current Lx in the figure
AleksandrR [38]

Explanation:

\frac{1}{8}  +  \frac{1}{2}   \\ 1.6 + 1.4 = 3 \\  \frac{1}{3}  +  \frac{1}{9}   \\ 2.25 + 2 = 4.25 \: ohm

R total = 4.25 ohm

I total = Vt/Rt

I total= 17/4.25= 4 A

Ix= 600 mA

\frac{9}{9 + 3}  \times 4 = 3\\   \frac{2}{2 + 8} \times 3 = 0.6a \\  = 0.6 \: milli \: amper

6 0
3 years ago
50 points what shape is mars
Artyom0805 [142]
A sphere.............
5 0
3 years ago
Read 2 more answers
Water is the working fluid in an ideal regenerative Rankine cycle with one open feedwater heater. Superheated vapor enters the f
Zepler [3.9K]

Answer:

a) The net powered developed will be 145715 KW.

b) The rate of Heat Transfer to the steam passing through the boiler will be 326340 KW.

c) The thermal efficiency will be 0.45.

d) The mass flow rate will be 884.09 kg/s.

Explanation:

8 0
3 years ago
Other questions:
  • 4. A 1 m3 rigid tank has propane at 100 kPa, 300 K and connected by a valve to another tank of 0.5 M3 with propane at 250 kPa, 4
    11·1 answer
  • The components of an electronic system dissipating 180 W are located in a 1-m-long horizontal duct whose cross section is 16 cm
    10·1 answer
  • How does it produce a 3D component?
    8·1 answer
  • Plot the following trig functions using subplots, choosing an appropriate layout for the number of functions displayed. The subp
    8·1 answer
  • Design a digital integrator using the impulse invariance method. Find and give a rough sketch of the amplitude response, and com
    15·1 answer
  • Select the correct answer
    8·1 answer
  • What the minimum wire size for a general residential application on a 20 A circuit
    7·1 answer
  • Their game off badminton is always on Tuesday
    11·1 answer
  • GOOD AFTERNOON GUYSS!! ​
    15·2 answers
  • Why is California a good place for engineers to build suspension bridges?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!