Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

This is Rectangle.H

image text in transcribed

This is Main.cc

image text in transcribed

This is my Circle.himage text in transcribed

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.r

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

2. How is net income or net loss shown in a worksheet?

Answered: 1 week ago

Question

what item decrease a stockholders basis in an s corporation

Answered: 1 week ago

Question

7. Understand the challenges of multilingualism.

Answered: 1 week ago

Question

5. Give examples of variations in contextual rules.

Answered: 1 week ago