Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This Point.H header This is Rectangle.H This is Main.cc This is my Circle.h 1.With what I have provided you guys with my headers and main.
This Point.H header
This is Rectangle.H
This is Main.cc
This is my Circle.h
1.With what I have provided you guys with my headers and main. I need to set up my circle and find it's distant function using Inheritance. Using whatever that is in my circle header to code a distant function that returns negative values when it is inside.
\#include \#include \#include "./circle. hn \#include "./rect. h" \#include "./point.h" using namespace std; [[noreturn]] void die () \{ cout "BAD INPUT! ; exit (1): int main() \{ const int CoLs = read ("Please enter number of columns: ); const int ROWS = read("Please enter number of rows: ) //YOU: Vet COLS and RONS to make sure it makes sense... or die()! // (You might be wondering if there is a better way than having three vectors... and there is.) vector> vec; //Holding all the shapes while (true) const int choice = read("Do you want to enter a 1) Asteroid, 2) Rectangle, 3) Circle? 4) Quit \ n") ; //You: Vet the asteroid to make sure it fits on the map... or die()! vec.push_back (make_shared(aster)) ; \} else if (choice ==2) \{ //Reads a new rect in using the operator > function in rect.h Rectangle rect = read("Please enter the x,y, half-w, half-h for a rectangle: ); /rou: Vet the rect to make sure it fits on the map \} else if (choice ==3 ) \{ //You: You need to make the operatory> for Circle in circle.h or this line won't compile Circle cir = read("Please enter the x,y,r for a circle: ") ); //You: Vet the circle to make sure it, fits on the map else if (choice ==4 ) \{ \} else die() for (int i=0;idistance_to(j, i)); int d= int (closest); else if (abs (d) >=10 ) cout 0 and d> and operator x (x),this->y(y),this->r(r){ friend std: :istream\& operator>>(std: :istream\& ins, Circle \&rhs) return ins rhs. x rhs. p rhs.rStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started