subject

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
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:00
Simon says is a memory game where "simon" outputs a sequence of 10 characters (r, g, b, y) and the user must repeat the sequence. create a for loop that compares the two strings starting from index 0. for each match, add one point to userscore. upon a mismatch, exit the loop using a break statement. assume simonpattern and userpattern are always the same length. ex: the following patterns yield a userscore of 4: simonpattern: rrgbryybgy userpattern: rrgbbrybgy
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
question
Computers and Technology, 23.06.2019 18:30
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
You know the right answer?
Circle class private members
double radius
double xPos
double yPos
public...
Questions
question
Mathematics, 06.04.2021 16:30
question
Mathematics, 06.04.2021 16:40
question
Mathematics, 06.04.2021 16:40
question
Mathematics, 06.04.2021 16:40
question
Mathematics, 06.04.2021 16:40
question
Mathematics, 06.04.2021 16:40