Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I am completely lost here... C++ clearly is not my forte. Anyhow, this is the pr

ID: 3759403 • Letter: I

Question

I am completely lost here... C++ clearly is not my forte. Anyhow, this is the program we are tasked with writing:

Define a class to represent an (x,y) coordinate

.

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 define operations on the point, such as the ability to the coordinates of the point, print the coordinates of the point, return the x - coordinate, and return the y - coordinate. Write code to demonstrate that you class is functional.

.

Define a class based on PointType

.

Every circle has a center and a radius. Given the radius, we can determine the circle’s area and circumference. Given the center, we can determine its position in the (x,y) plane. The center of the circle is a point in the (x,y) plane. Design a class circleType, that can store the radius and center of the circle. Because the center is a point in the (x,y) plane and you designed the class to capture the properties of a point, you must derive the classcircleType from the class pointType. You should be able to perform the usual operations on the circle, such as setting the radius, printing the radius, calculating and printing the area and circumference, and carrying out the usual operations on the center.

.

Also, write a program to test various operations on a circle.

I am lookiong to get this program all into one file. Thanks.

Explanation / Answer

#include <iostream>
#include <cmath>
#include <valarray>
using namespace std;

int main ()
{
  
int PointX = 3;
int PointY = 5;

bool result = IsPointWithinCircle(1,2,5, PointX, PointY)
if(result == true)
     cout<<"Point is within";
else
     cout<<"Point is outside";

return 0;
}

public bool IsPointWithinCircle(int CenterX, int CenterY, int radius, int PointX, int PointY)
{
   bool IsPointWithin = false;

    float dist = sqrt( (CenterX - PointX)* (CenterX - PointX) + (CenterY - PointY)* (CenterY - PointY));
if (dist > radius)
{
      IsPointWithin = true;
}
      return IsPointWithin;
}