code:
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
#define Pi 3.1416
float FindRadius(float xPoint, float
yPoint, float xCenter, float yCenter)
{
return sqrt(pow((xCenter-xPoint),2) +
pow((yCenter-yPoint),2));
}
void CircleCalculations(float radius,
float *circumference, float *area)
{
*circumference = 2*Pi*radius; //passing result by reference
*area = Pi*radius*radius;
}
void PrintCircle(float radius, float
circumference, float area)
{
std::cout << std::fixed;
std::cout << std::setprecision(2); //setting result to 2
decimal places
I he following formula gives the distance between two points (x1, yl) and (02, y2) in...
Using separate files, write the definition for a class called Point and a class called Circle. The class point has the data members x (double) and y (double) for the x and y coordinates. The class has the following member functions: a) void set_x(double) to set the x data member b) void set_y(double) to set the y data member c) double get_x() to return the the x data member d) double get_y() to return the the y data member e)...
Complete the following coding in java Create a class Circle that represents a round moving dot. A circle object needs to contain double variables to store the: Current X location of the circle's center Current Y location of the circle's center Radius of the circle Direction of the circle's movement in radians Speed of the circle's movement . . The Circle class must contain a constructor Circle double x, double y, double radius) that initializes the circles center x, y...
I need help with C, please don't copy other answers!! Thanks Declare a structure to represent a circle. Each circle stores information about the center and the radius. Center is represents with x and y coordinates. Both center and radius uses doubles. Allocate an array of 502 circle pointers and dynamically allocated memory to store a circle pointed by each array entry. Randomly generate circles using the following function. double rand_ float (double a, double b) {return ((double) rand()/RAND_MAX) *...
U8ing separate files, write th definition for a clas called Poit and a class called Cirele 1. The class point has the data members (double) and y (double) for the x and y coordinates The class has the following ember functions a) void set x (double) to set the x data member b) void set y(double) to set the y data member c) double get-x() to return th the data member d) double get yO to zeturn the the y...
Question 11 (20 points) Given the class Point below, define a class Circle that represent a circle with a given center and radius. The circle class should have a center attribute named center as well as a floating point radius attribute. The center is a point object, defined by the class Point. The class should also have these members: the constructor of the class, which should take parameters to initialize all attributes - a getter for center a setter for...
Three geometric entities (a circle, a rectangle and a triangle) should be first randomized using rand function in line with srand(time(NULL)). These three geometrric entities can/should be represented using the following C struct samples in your program: Write three functions for each geometric entity that randomizes the geometric parameters (such as center X and Y coordinates and radius for a circle) and returns these geometries (such as struct Circle, struct Rectangle and struct Triangle). Note that floating numbers should be...
I need to implement a program that requests a x,y point and the radius of a circle. then it figures out the area and circumference using an overloaded operation. The full instructions, what I have and the errors I have are below. A point in the x-y plane is represented by its x-coordinate and y-coordinate. Design a class, pointType, that can store and process a point in the x-y plane. You should then perform operations on the point, such as...