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
Using data in Appendix A ,calculate the number of atoms in 1 tonne of iron
maksim [4K]
<h2>Answer:</h2>

1.0783*10^{28}(atoms).

<h2>Explanation:</h2>

<em>Since I don't have access to "Appendix A", I'll solve the problem using data from the periodic table.</em>

<em />

<h3>1. Determine the molar mass of iron.</h3>

<em>According to the periodic table, the molar mass of iron is:</em>

55.845g/mole.

<h3>2. Convert 1 tonne to grams.</h3>

1(tonne)*1000=1000kg\\1000kg*1000=1000000g=10^6g

<h3>3. Apply rule of 3.</h3>

55.845g ----------- 1 mole

10^6g ----------- x

x=\frac{10^6*1}{55.845}=17906.7061(moles)

<h3>4. Determine the amount of atoms.</h3>

<em>Considering that there are, approximately, </em>6.022*10^{23} atoms in a mole of any element, apply another rule of 3.

1 mole --------------------- 6.022*10^{23}(atoms)

17906.7061(moles) --------------------- x

x=\frac{17906.7061*6.022*10^{23}}{1}=1.0783*10^{28}.

4 0
2 years ago
A work element in a manual assembly task consists of the following MTM-1 elements: (1) R16C, (2) G4A, (3) M10B5, (4) RL1, (5) R1
ella [17]

Answer:

a)

1) R16C ; Tn = 17 TMU

2) G4A ; Tn = 7.3 TMU

3) M10B5 ; Tn = 15.1 TMU

4) RL1 ; Tn = 2 TMU

5) R14B ; Tn = 14.4 TMU

6) G1B ; Tn = 3.5 TMU

7) M8C3 ; Tn = 14.7 TMU

8) P1NSE ; Tn = 10.4 TMU

9) RL1 ; Tn = 2 TMU

b) 3.1 secs

Explanation:

a) Determine the normal times in TMUs for these motion elements

1) R16C ; Tn = 17 TMU

2) G4A ; Tn = 7.3 TMU

3) M10B5 ; Tn = 15.1 TMU

4) RL1 ; Tn = 2 TMU

5) R14B ; Tn = 14.4 TMU

6) G1B ; Tn = 3.5 TMU

7) M8C3 ; Tn = 14.7 TMU

8) P1NSE ; Tn = 10.4 TMU

9) RL1 ; Tn = 2 TMU

b ) Determine the total time for this work element in seconds

first we have to determine the total TMU = ∑ TMU = 86.4 TMU

note ; 1 TMU = 0.036 seconds

hence the total time for the work in seconds = 86.4 * 0.036 = 3.1 seconds

7 0
3 years ago
At a high school science fair, Connor won first place for his replica of the Golden Gate Bridge. Connor liked the project so muc
AnnZ [28]

Answer:

a

Explanation:

6 0
4 years ago
Quinn’s relatives relayed a story about putting on a headset and seeing a digital world that they could walk around in and explo
Kryger [21]

Answer:

I know it is C)Virtual reality

Explanation:

Look at the clues

story about putting on a headset ( virtual reality head set!)

seeing a digital world (A virtual reality world)

they could walk around in (Fake walking you are basically jogging in place)

explore in order to see what ancient Benin looked like (Looking at a real place only digitally)

as if they were really there ( they think they are actually there)

The only reason I know all of this is because I have done virtual reality multiple times and I LOVED it SUPER fun ( I was doing archery) :) Hope this helps!

6 0
3 years ago
Read 2 more answers
Motorcycles are extremely hard to see if they are _______. powered by quiet motors approaching from the side driving on the shou
Assoli18 [71]

Answer: uve earned 5 b point for helping us

Explanation:well know I'm not helping u

7 0
3 years ago
Other questions:
  • Type the correct answer in the box. Spell all words correctly.
    6·1 answer
  • What safty device in a pneumatic system prevents over pressurization of the compressor tank? 1) filter/dryer 2)pop-off valve 3)r
    12·1 answer
  • What are the 3 stages of reverse engineering?
    14·1 answer
  • 2. The block is released from rest at the position shown, figure 1. The coefficient of
    9·1 answer
  • A robot with artificial intelligence would best be suited for
    11·1 answer
  • What is the general relationship between drill press speed and drill bit size?
    9·1 answer
  • A compound cylinder is formed by shrinking a tube of 250 mm internal diameter and 25 mm wall thickness onto another tube of 250
    12·1 answer
  • Damage reports should contain the information needed for what?
    8·1 answer
  • According to the video, what qualities do Traffic Technicians need? Check all that apply.
    14·1 answer
  • 1. A loss of braking effectiveness due to too much heat in the brakes is called
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!