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
As a means of preventing ice formation on the wings of a small, private aircraft, it is proposed that electric resistance heatin
DIA [1.3K]

Answer:

Average heat flux=3729.82 W/m^{2}

Explanation:

7 0
2 years ago
Suppose you want to find the sum of two sinusoidal voltages, given as follows: v1(t)=V1 cos(ωt+ϕ1) and v2(t)=V2 cos(ωt+ϕ2)v1(t)=
seropon [69]

Answer:

Attached is the full solution.

3 0
2 years ago
Read 2 more answers
investigation, determine when the Elastic Potential Energy is zero. Make sure you test your idea with several masses, all three
nata0808 [166]

Elastic Potential Energy is zero detailed description is given below.

Explanation:

  • It is the energy stored in stretched or compressed elastic materials. This also means that elastic potential energy is zero in objects that have not been stretched or compressed.
  • To determine the gravitational potential energy of an object, a zero height position must first be arbitrarily assigned. Typically, the ground is considered to be a position of zero height. But this is merely an arbitrarily assigned position that most people agree upon. Since many of our labs are done on tabletops, it is often customary to assign the tabletop to be the zero height position. Again this is merely arbitrary. If the tabletop is the zero position, then the potential energy of an object is based upon its height relative to the tabletop. For example, a pendulum bob swinging to and from above the tabletop has a potential energy that can be measured based on its height above the tabletop. By measuring the mass of the bob and the height of the bob above the tabletop, the potential energy of the bob can be determined.

  • Potential energy is the energy that is stored in an object due to its position relative to some zero position. An object possesses gravitational potential energy if it is positioned at a height above (or below) the zero height. An object possesses elastic potential energy if it is at a position on an elastic medium other than the equilibrium position.

Since the gravitational potential energy of an object is directly proportional to its height above the zero position, a doubling of the height will result in a doubling of the gravitational potential energy. A tripling of the height will result in a tripling of the gravitational potential energy.

6 0
3 years ago
The shear flow at the point depends on the value of Q for the portion of the upper flange to the right of the point. Calculate t
Ostrovityanka [42]

Q)The shear flow at a point is given by q = 1 of 2 An I-beam has a flange width b = 200 mm , height h = 200 mm , web thickness tw = 8 mm, and flange thickness t = 12 mm, For the given point The shear flow at the point depends on the value of Q for the portion of the upper flange to the right of the point. Calculate the value of Q. Express your answer with appropriate units to three significant figures.( <u>I have also attached the diagram for better understanding)</u>

Answer:

Q = 56400 mm^3

Explanation:

<u>I have given the explanation in the attached file below.</u>

6 0
3 years ago
technician a says that use of firmer, urethane bushings in the suspension improves the vehicle's road-holding ability and handli
tensa zangetsu [6.8K]

it is technician B i belive im not sure the question tho

5 0
2 years ago
Other questions:
  • Which goal incorporates most of the criteria required for a SMART goal?
    8·1 answer
  • What is the magnitude of the maximum stress that exists at the tip of an internal crack having a radius of curvature of 1.9 × 10
    7·1 answer
  • How are the accelerator and brake pedal positioned in relation to each other? A. The brake pedal is to the right of the accelera
    5·1 answer
  • 5. Consider the LTI system defined by the differential equation (a) Draw the pole-zero plot for the system. Is the system stable
    12·1 answer
  • What is computer software​
    5·1 answer
  • What did August Comte contribute to sociology including positivism
    11·1 answer
  • Select the correct answer. Felix aspires to be an engineer working for the government. What credentials will Felix require to ap
    5·1 answer
  • In the following scenario, what could the engineers have done to keep the bridge from collapsing?
    8·1 answer
  • An interrupted line of sight means changes in ......and .... are necessary for re-establishing a ......... to the driver’s path
    7·1 answer
  • technician a says that dirt bypassing the filter on many common rail injectors can cause an injector to stick open and continuou
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!