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
An 80-L vessel contains 4 kg of refrigerant-134a at a pressure of 160kPa. Determine (a) the temperature, (b) the quality, (c) th
makvit [3.9K]

Answer:

temperature -15.6 C, quality x=0.646, enthalpy h=667.20 KJ, volume of vapor phase Vg= 79.8 L

Explanation:

property table for R-134a

https://www.ohio.edu/mechanical/thermo/property_tables/R134a/R134a_PresSat.html

at 160 KPa , temperature = -15.66 C

quality x=mass of vapour/ total mass of liq-vap mixture

alternaternately: x=(v-vf)/(vg-vf)    

v=total volume i.e. volume of container"80L"   80L=0.08 cubic meter

vf=vol of liquid phase  vg=vol of vapor phase vf, vg values at 160Kpa

x=(0.08-0.0007437)/(0.1235-0.0007437)=0.646

enthalpy

h=hf+xhfg          hf, hfg values at 160Kpa

h=hf+xhfg=31.2+0.646(209.9)=166.80 KJ/Kg

for 4Kg R-134a h=m(166.80 KJ/Kg )=667.20 KJ

volume of vapor phase

vg at 160Kpa=0.1235 cubic meter for quality=1.

in this case quality=0.646 , so it will occupy 64.6% space of the vapor phase at quality=1.

vol. of vapor phase=0.646*0.1235=0.0798 cubic meter=79.8 L

7 0
2 years ago
What is the ILS stand for
Alika [10]

Answer:

Instrument Landing System

Explanation:

The ILS works by sending radio waves from the runway to the aircraft. Which is then intercepted and is used to guide the aircraft onto the runway.

6 0
3 years ago
Read 2 more answers
A small family home in Tucson, Arizona has a rooftop area of 2667 square feet, and it is possible to capture rain falling on abo
Kazeer [188]

Answer:

volume  = 53.747 m3 = 14198.138 gal

weight = 526652 N = 118396.08 lbf

Explanation:

We know that volume of water

volume  =  A'\times H

where A' = 61% of A

              = 0.61\times 2667 = 1626.87 sq ft

volume  =  1626.87 \times (\frac{14}{12} ft)

               =1898.015 ft^3

in\ m^3 = \frac{ 1898.015}{35.315} =   53.7457 m^3

in\ gallon = 1898.015 \times 7.481 = 14198.138 gallon

weight = \rho Vg

       = 1000\times 53.74\times 9.8

             =526652 N

In\ lbf =  \frac{526652}{4.448} = 118396.08 lbf

7 0
3 years ago
Calculate the availability of a system where the mean time between failures is 900 hours and the mean time to repair is 100 hour
Debora [2.8K]

Answer:

The availability of system will be 0.9

Explanation:

We have given mean time of failure = 900 hours

Mean time [to repair = 100 hour

We have to find availability of system

Availability of system is given by  \frac{mean\time\ of\ failure}{mean\ time\ of\ failure+mean\ time\ to\ repair}

So availability of system =\frac{900}{900+100}=\frac{900}{1000}=0.9

So the availability of system will be 0.9

7 0
3 years ago
Is the ASUS ROG Strix B450-F Gaming amd ryzen 5 3600 ready?
Ulleksa [173]

Answer:

yep

Explanation:

7 0
2 years ago
Read 2 more answers
Other questions:
  • An equal-tangent sag vertical curve connects a 1% and 3% initial and final grades, respectively, and is designed for 70 mph. The
    12·1 answer
  • Some engineers have developed a device that provides lighting to rural areas with no access to grid electricity. The device is i
    13·1 answer
  • Project 8:The Harris-Benedict equation estimates the number of calories your body needs to maintain your weight if you do no exe
    5·1 answer
  • 7. A single-pole GFCI breaker is rated at
    9·1 answer
  • Home safety and security is an _________<br><br> process. (7 Letters)<br><br> Answer
    10·1 answer
  • I really need help i will give brainly plz no funny answers
    14·1 answer
  • If a nurse does not agree to the discipline set due to a complaint made against this nurse, after reviewing the proposed agreed
    14·1 answer
  • Please help I am give brainiliest
    9·1 answer
  • What computer program can you use to publish and share a research project with others?
    7·1 answer
  • Which one of the following best defines hardness: (a) energy absorbed by a material when an object strikes its surface, (b) resi
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!