Circle class
private members
double radius
double xPos
double yPos
public...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 05.05.2021 19:40 AlaskaAirlines
Circle class
private members
double radius
double xPos
double yPos
public members
double diameter()
get the diameter of the Circle. It returns a value, diameter.
double area()
calculate the area of the Circle
double circumference()
calculate the circumference of the circle
double getRadius()
returns the radius
double getX()
returns the xPos value
double getY()
returns the yPos value
void setX(double x)
sets xPos, no requirements
void setY(double y)
sets yPos, no requirements
double distanceToOrigin()
returns the distance from the center of the circle to the origin
HINT: Find out how to calculate the distance between two points and recall the origin is at (0,0)
bool insersect(const Circle& otherCircle)
Take another Circle by const reference (see more notes below)
Returns true if the other Circle intersects with it, false otherwise
bool setRadius(double r)
sets the radius to r and returns true if r is greater than zero, otherwise sets the radius to zero and returns false
Remember, you will need a header file (.h) and an implementation file (.cpp)
You'll also need to update your Makefile
NOTE: The Circle class should not do any input or output.
CircleDriver class
private members
Circle circ1;
Circle circ2;
void obtainCircles()
Talk with the user to obtain the positions and radii for two Circles from the user. Repeats prompts until the user gives valid values for the radii
It does not validate the values, but rather checks the return value from a call to Circle's setRadius method
void printCircleInfo()
Prints the following information about each of the Circles to the screen:
The location of the Circle's center (xPos, yPos), the distance from the origin, each area, circumference, diameter
Lastly print whether or not the two circles intersect
Sample output from printCircleInfo().
Information for Circle 1:
location: (0, 50.0)
diameter: 200.0
area: 31415.9
circumference: 628.318
distance from the origin: 50.0
Information for Circle 2:
location: (50.0, 0)
diameter: 200.0
area: 31415.9
circumference: 628.318
distance from the origin: 50.0
The circles intersect.
public membersvoid run()
run merely calls all the other methods. Here's your definition for run()
//This will go in your CircleDriver. cpp
void CircleDriver::run()
{
obtainCircles();
printCircleInfo();
}
main
Main does very little. In fact, here is your main:
int main()
{
CircleDriver myDriver;
myDriver. run();
return(0);
}
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 04:00
Which of the following kinds of programs displays an online advertisement in a banner or pop-up window on webpages, email, or other internet service? e
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 17:00
Aisha has finished working on a word processing document that contains 15 pages. she has added some special elements in the first three pages, page 9 and 10, and page 15 from the document. she wants to print only these pages to see how they look. which option is the correct way to represent (in the print dialog box) the pages that aisha wants to print
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 19:10
How might the success of your campaign be affected if you havenβt carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 06:30
On early television stations, what typically filled the screen from around 11pm until 6am? test dummies test patterns tests testing colors
Answers: 1
You know the right answer?
Questions
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/en.png)
English, 16.09.2020 09:01
![question](/tpl/images/cats/fizika.png)
Physics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/istoriya.png)
History, 16.09.2020 09:01
![question](/tpl/images/cats/en.png)
English, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01
![question](/tpl/images/cats/mat.png)
Mathematics, 16.09.2020 09:01