Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please fast i dont have a time c++ #include using namespace std; class Point private: int x,y; public: Point (int a=0,int b=0); // initialize the

image text in transcribed

please fast i dont have a time c++

#include using namespace std; class Point private: int x,y; public: Point (int a=0,int b=0); // initialize the x and y coordinates of a Point double Distance(Point &C); // calculates the distance between two locations, the value is in meters void print(); // prints the x and y coordinates of a Point void setData(int a, int b); // set the values of the x and y coordinates of a Point 3: Assume all functions of the class point are defined and implemented correctly. Read the comments to understand the usage of the function. You cannot modify the above class. Create a class Rocket that has the following data attributes: coordinates, ID of type integer, speed of type integer. The coordinates represents the x and y location of the rocket, make use of class point. ID is a constant serial integer that is given values according to the following serial numbers 100, 200, 300, etc. Do not separate class implementation The class should have the following member functions: 1. A default constructor. 2. An initializer constructor to initialize all data members of a Rocket, do any necessary validations 3. A copy constructor. Write setter and getter functions for speed data member. 5. A function bool Safe (Rocket& r) that returns true if the two Rocket objects are in safe distance from each other. Two Rockets are considered in safe distance not to hit each other if they are 100 meters or more far from each other. 6. A function double Distance (Rocket&r) that returns the distance between two Rocket objects. Note: you must use the Distance function in Point class

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_2

Step: 3

blur-text-image_3

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

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

More Books

Students also viewed these Databases questions

Question

Help Please tre. tre

Answered: 1 week ago