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
Which of these fuel injection systems operates with fuel injectors located only in the intake manifold near each intake
Stella [2.4K]

Answer:

C. Multipoint fuel injection

Explanation:

A fuel injection system can be defined as a system found in the engine of most automobile cars, used for the supply of a precise amount of fuel or fuel-air mixture to the cylinders in an internal combustion engine through the use of an injector.

There are different types of fuel injection system and these includes;

I. Central-point injection.

II. Throttle (single point) body injection.

III. Gasoline direct injection.

IV. Multipoint (port) fuel injection.

Multipoint fuel injection is a type of fuel injection system that operates with fuel injectors located only in the intake manifold near each intake valve and sprays fuel toward the valve. As a result, it allows for the supply of a precise amount of fuel and as such creating a better air-fuel ratio for automobile cars.

8 0
2 years ago
An automated transfer line is to be designed. Based on previous experience, the average downtime per occurrence = 5.0 min, and t
IRINA_888 [86]

Answer:

a) 28 stations

b) Rp = 21.43

E = 0.5

Explanation:

Given:

Average downtime per occurrence = 5.0 min

Probability that leads to downtime, d= 0.01

Total work time, Tc = 39.2 min

a) For the optimum number of stations on the line that will maximize production rate.

Maximizing Rp =minimizing Tp

Tp = Tc + Ftd

=  \frac{39.2}{n} + (n * 0.01 * 5.0)

= \frac{39.2}{n} + (n * 0.05)

At minimum pt. = 0, we have:

dTp/dn = 0

= \frac{-39.2}{n^2} + 0.05 = 0

Solving for n²:

n^2 = \frac{39.2}{0.05} = 784

n = \sqrt{784} = 28

The optimum number of stations on the line that will maximize production rate is 28 stations.

b) Tp = \frac{39.2}{28} + (28 * 0.01 * 5)

Tp = 1.4 +1.4 = 2.8

The production rate, Rp =

\frac{60min}{2.8} = 21.43

The proportion uptime,

E = \frac{1.4}{2.8} = 0.5

3 0
3 years ago
A rigid tank contains 3 kg of water initially at 43.97% quality and at a temperature of 120°C. The water is heated until it reac
makkiz [27]

Explanation: see attachment below

6 0
2 years ago
g A circular oil slick of uniform thickness is caused by a spill of one cubic meter of oil. The thickness of the oil slick is de
Anika [276]

Answer:

the rate of increase of radius is dR/dt = 0.804 m/hour = 80.4 cm/hour

Explanation:

the slick of oil can be modelled as a cylinder of radius R and thickness h, therefore the volume V is

V = πR² * h

thus

h = V / (πR²)

Considering that the volume of the slick remains constant, the rate of change of radius will be

dh/dt = V d[1/(πR²)]/dt

dh/dt = (V/π) (-2)/R³ *dR/dt

therefore

dR/dt = (-dh/dt)* (R³/2) * (π/V)

where dR/dt = rate of increase of the radius , (-dh/dt)= rate of decrease of thickness

when the radius is R=8 m , dR/dt is

dR/dt = (-dh/dt)* (R³/2) * (π/V) = 0.1 cm/hour *(8m)³/2 * π/1m³ *(1m/100 cm)= 0.804 m/hour = 80.4 cm/hour

4 0
3 years ago
The common type of defects found when soldering on a printed circuit board
sammy [17]

Explanation:

Solder Bridges

Plating Voids

Non-wetting or dewetting.

5 0
3 years ago
Other questions:
  • What are the three main areas of bioengineering?
    11·1 answer
  • A circular hoop sits in a stream of water, oriented perpendicular to the current. If the area of the hoop is doubled, the flux (
    8·1 answer
  • A prototype boat is 30 meters long and is designed to cruise at 9 m/s. Its drag is to be simulated by a 0.5-meter-long model pul
    6·1 answer
  • A 3-phase induction motor with 4 poles is being driven at 45 Hz and is running in its normal operating range. When connected to
    12·1 answer
  • Air enters a tank through an area of 0.2 ft2 with a velocity of 15 ft/s and a density of 0.03 slug/ft3. Air leaves with a veloci
    5·1 answer
  • Consider a Carnot refrigeration cycle executed in a closed system in the saturated liquid-vapor mixture region using 0.96 kg of
    11·1 answer
  • The basic barometer can be used to measure the height of a building. If the barometric readings at the top and at the bottom of
    13·1 answer
  • Route Choice The cost of roadway improvements to the developer is a function of the amount of traffic being generated by the the
    11·1 answer
  • A center-point bending test was performed on a 2 in. x d in. wood lumber according to ASTM D198 procedure with a span of 4 ft an
    12·1 answer
  • The product of two factors is 4,500. If one of the factors is 90, which is the other factor?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!