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]
4 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]4 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
The soil borrow material to be used to construct a highway embankment has a mass unit weight of 107.0 lb/cf and a water content
MrRissso [65]

Answer:

Option D

Explanation:

Given information

Bulk unit weight of 107.0 lb/cf

Water content of 7.3%,=0.073

Specific gravity of the soil solids is 2.62

Specifications

Dry unit weight is 113 lb/cf  

Water content is 6%.

Volume of embankment is 440,000-cy

Borrow material

Dry_{unit,weight}=\frac {bulk_{unit,weight}}{1+water_{content}}=\frac {107}{1+0.073}= 99.72041 lb/cf  

Embankment

Considering that the volume of embankment is inversely proportional to the dry unit weight

\frac {V_{embankment}}{V_{borrow}}=\frac {Dry_{borrow}}{Dry_{embankment}}

Therefore, V_{borrow}=V_{embankment} *\frac {Dry_{embarkement}}{Dry_{borrow}}

V_{borrow}=440,000-cy*\frac {113 lb/cf }{99.72041 lb/cf }= 498594-cy

Therefore, volume of borrow material is 498594-cy

(b)

The weight of water in embankment is found by multiplying the moisture content and dry unit weight.

Assuming that all the specifications are achieved, weight of water in embankment=0.06*113=6.78 lb/cf

Since 1 yd^{3}= 27 ft^{3}

The embankment requires water of  6.78*27*440000= 80546400 lb

Borrow materials’ water will also be 0.073*99.72041=7.27959 lb/cf

Borrow material requires water of 7.27959*27*498594=97998120 lb

Extra water between borrow material and embankment=97998120 lb-80546400 lb=17451720 lb

Unit_{weight}=\frac {17451720}{498594}=35.00186 lb

1 gallon is approximately 8.35 yd^{3} hence

\frac {35.00186 lb/yd^{3}}{8.35}=4.19184 gallons/yd^{3}

That's approximately 4.2 gallons

7 0
3 years ago
Establishes general guidelines concerning licensing and vehicle
gavmur [86]

Answer:

A. National Highway Safety Act

Explanation:

The National Highway Safety Act establishes general guidelines concerning licensing, vehicle registration and inspection, and traffic laws for state regulations. The act was made in 1966 to reduce the amount of death on the highway as a result of increase in deaths by 30% between 1960 and 1965

National Traffic and Motor Vehicle Safety Act regulates vehicle manufacturers  by ensuring national safety standards and issuance recalls for defective vehicles

Uniform Traffic Control Devices Act  defines shapes, colors and locations for road signs, traffic signals, and road markings

5 0
3 years ago
Read 2 more answers
Calculate the differential pressure in kPa across the hatch of a submarine 320m below the surface of the sea. Assume the atmosph
kicyunya [14]

Answer:

The pressure difference across hatch of the submarine is 3217.68 kpa.

Explanation:

Gauge pressure is the pressure above the atmospheric pressure. If we consider gauge pressure for finding pressure differential then no need to consider atmospheric pressure as they will cancel out. According to hydrostatic law, pressure varies in the z direction only.  

Given:

Height of the hatch is 320 m

Surface gravity of the sea water is 1.025.

Density of water 1000 kg/m³.

Calculation:

Step1

Density of sea water is calculated as follows:

S.G=\frac{\rho_{sw}}{\rho_{w}}

Here, density of sea water is\rho_{sw}, surface gravity is S.G and density of water is \rho_{w}.

Substitute all the values in the above equation as follows:

S.G=\frac{\rho_{sw}}{\rho_{w}}

1.025=\frac{\rho_{sw}}{1000}

\rho_{sw}=1025 kg/m³.

Step2

Difference in pressure is calculated as follows:

\bigtriangleup p=rho_{sw}gh

\bigtriangleup p=1025\times9.81\times320

\bigtriangleup p=3217680 pa.

Or

\bigtriangleup p=(3217680pa)(\frac{1kpa}{100pa})

\bigtriangleup p=3217.68 kpa.

Thus, the pressure difference across hatch of the submarine is 3217.68 kpa.

6 0
3 years ago
Technician a says that if a tapered roller bearing is adjusted to loose
Effectus [21]
The technician is true
5 0
3 years ago
Pumped-storage hydroelectricity is a type of hydroelectric energy storage used by electric power systems for load balancing. The
NikAS [45]

Answer:

A) energy loss E = pgQtH

Where p = density in kg/m3

g = gravity acceleration in m/s2

Q = flow rate in m3/s

t = time taken for flow in sec

H = height of flow in m

B) power required to run pump;

P = pgQH

Explanation:

Detailed explanation and calculation is shown in the image below

5 0
3 years ago
Other questions:
  • What is 100 kPa in psia?
    11·1 answer
  • Oil with a specific gravity of 0.72 is used as the indicating fluid in a manometer. If the differential pressure across the ends
    6·1 answer
  • A team member who has been a good worker for many years has recently been doing poor work. You suspect that he may be tired of h
    6·1 answer
  • 1. Which of the following is the ideal way to apply pressure onto pedals?
    14·2 answers
  • A column carries 5400 pounds of load and is supported on a spread footing. The footing rests on coarse sand. Design the smallest
    10·1 answer
  • Which word from the passage best explains what the web in the passage symbolizes
    10·1 answer
  • A proposed embankment fill requires 7100 ft of compacted soil. The void ratio of the compacted fill is specified as 0.5. Four bo
    10·1 answer
  • I love touching the atmospheres crest
    8·1 answer
  • Which of following is not malicious ?<br> Worm<br> Trogan Horse<br> Driver<br> Virus
    8·1 answer
  • Hole filling fasteners (for example, MS20470 rivets) should not be used in composite structures primarily because of the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!