Question

Hor this assignment you are provided the files for a class called point. Download the h and .cpp files and include them in yoYou are to overload the stream insertion operator (operato to output the details of a rectangle. The output must be formattedOverload the subtract assign operator (operator with a reference to a rectangle argument. The operation of the function is toOther member functions Creale a function called getEdge (int). The function accepts an integer argument. The operation of the2. Put these points in an array called points. 3. Create the following rectangles Rectangle variable XY R1 R2 R.3 R4 R5 R6 R18. Write code to go through the rectangles array and use the operatorwith the value 5 19. Call the show function again 20. R1 2 3 #ifndef POINT #de fine POINT using namespace std; class point 6 friend ostream& operator<< (ostream& ct, point& pt); frpoint.cpp 3 # include point . h ostream& operator<< (ostream& point& pt) ct, return ct istream& operator>> (istream& cn, po$ ./a.out R3R6: No ?R6 R7: Yes At array initialisation R0 3.5, 7.6) 20.0 6.0] R[1 7.6, 3.5) 6.0 3.0] R[21F 10.1,10.8) 1.0* 1.R[2110.1,10.8) 6.0* 6.0] R(310.5,10.5) 7.0* 8.0] R[41- 3.5, 6.5) 27.0 20.0] R[515.4, 5.4) 9.0* 9.0] R[61 5.4, 5.4) 9.0 9.0] RR[1] contains P[5] R[2] contains P(2] R[2] contains P[3] R[3] contains P[2] R[3] contains PI3] R[4] contains P[0] R[4] contai


The both files are included. Where are these which are colorful. Point.h and point.cpp
Hor this assignment you are provided the files for a class called point. Download the h and .cpp files and include them in your project. IheじML diagram below details the class Point くくfriend>> ostream& operator.((ostream&, point&) (const point& pt) *students must complete this 4 6 47 48 49 50 51 52 53 54 *Similar to the above, overload the less than * of equal to. bool point: :operator (const point& pt) 56 57 58 *students must complete this
$ ./a.out R3R6: No ?R6 R7: Yes At array initialisation R0 3.5, 7.6) 20.0 6.0] R[1 7.6, 3.5) 6.0 3.0] R[21F 10.1,10.8) 1.0* 1.0] R[3110.5,10.5) 2.0* 3.0] RI4F 3.5, 6.5) 22.0* 15.0] R[51- 5.4, 5.4) 4.0* 4.0] R[6- 5.4, 5.4) 4.0" 4.0] There are 3 squares in the array The largest rectangle is at index: 4 The object is: [i 3.5, 6.5) 22.0 15.0] R0H3.5, 7.6) 20.0 6.0] R1- 7.6, 3.5) 6.0* 3.0] R[2F10.1,10.8) 1.0* 1.0] R[31 10.5,10.5) 2.0* 3.0] R43.5, 6.5) 22.0* 15.0] R55.4, 5.4) 4.0* 4.0] R[61- 5.4, 5.4) 4.0* 4.0] R[O] contains PIO] R[0] contains P[2] R[O] contains P[3] R[1] contains P[1] R[1] contains P[5] R[2] contains P[2] R[3] contains P[3] R[4] contains P[O] R[4] contains P[2] R[4] contains P[3] R[4] contains P[4] R[O] contains R[2] R[0] contains R[3] R[4] contains R(O] R[4] contains R[2] R[4] contains R[3] R[5] contains R[6] R[6 contains R[5] after using +-5 R[0 3.5, 7.6) 25.0 11.0] R17.6, 3.5) 11.0* 8.0]

R[1] contains P[5] R[2] contains P(2] R[2] contains P[3] R[3] contains P[2] R[3] contains PI3] R[4] contains P[0] R[4] contains P[1] RI4] contains PI2] R[4] contains P[3] R[4] contains P[4] R[4] contains PI5] R[4] contains P[6] R[5] contains P[O] R[5l contains P[1] R[5] contains PI2] R5 contains P[3] R[5] contains P4] R[5] contains P[5] R[5] contains P[6] R[6] contains P[O] R[6] contains P[1] R[6] contains P[2] R[6] contains PI3] R[6] contains P[4] R[6] contains P[5] R[6] contains P[6] R[O] contains R[2] R[O] contains R[3] R[4] contains R[O] R[4] contains R[2] R[4] contains R[3] R[5] contains R[6] R[6] contains R[S]
0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you have any doubts, please give me comment...

bool point::operator>=(const point& pt){

if(x>=pt.getX() && y>=pt.getY())

return true;

return false;

}

bool point::operator<=(const point& pt){

if(x<=pt.getX() && y<=pt.getY())

return true;

return false;

}

Add a comment
Know the answer?
Add Answer to:
The both files are included. Where are these which are colorful. Point.h and point.cpp Hor this assignment you are provided the files for a class called point. Download the h and .cpp files and incl...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using separate files, write the definition for a class called Point and a class called Circle. Th...

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

  • In Java please! Problem You will be using the point class discussed in class to create...

    In Java please! Problem You will be using the point class discussed in class to create a Rectangle class. You also need to have a driver class that tests your rectangle. Requirements You must implement the 3 classes in the class diagram below and use the same naming and data types. Following is a description of what each method does. Point Rectangle RectangleDriver - x: int - top Left: Point + main(args: String[) - y: int - width: int +...

  • Files given in this assignment (right-click on the file to download) Assignment7.cpp (need to complete) Student.h...

    Files given in this assignment (right-click on the file to download) Assignment7.cpp (need to complete) Student.h (Given. Just use it, don't change it!) Student.cpp (Partially filled, need to complete) 1. Assignment description In this assignment, you will write a simple class roster management system for ASU CSE100. Step #1: First, you will need to finish the design of class Student. See the following UML diagram for Student class, the relevant header file (class declaration) is given to you as Student.h,...

  • U8ing separate files, write th definition for a clas called Poit and a class called Cirele...

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

  • Here's an assignment that'll give you some practice with pointers. All you have to do is...

    Here's an assignment that'll give you some practice with pointers. All you have to do is write a program that allows the user to populate an array of doubles (5 values) by calling the function InitArray. After the user has entered all the values, then call the function DispRevArray to display the array in reverse. Main will create and allocate space for an array of type double for 5 elements. Then you will create and allocate a pointer that will...

  • C++ CODE /* This is program project 2 on page 695. * Before you begin the...

    C++ CODE /* This is program project 2 on page 695. * Before you begin the project, please read the project description * on page 695 first. * * Author: Your Name * Version: Dates */ #include <iostream> #include <cmath> #include <cassert> using namespace std; class Fraction { public: // constructor Fraction(int a, int b); // generate a fraction which is a/b Fraction(int a); // generate a fraction which is a/1 Fraction(); // generate a fraction which is 0/1. i.e...

  • C++ CODE /* This is program project 2 on page 695. * Before you begin the...

    C++ CODE /* This is program project 2 on page 695. * Before you begin the project, please read the project description * on page 695 first. * * Author: Your Name * Version: Dates */ #include <iostream> #include <cmath> #include <cassert> using namespace std; class Fraction { public: // constructor Fraction(int a, int b); // generate a fraction which is a/b Fraction(int a); // generate a fraction which is a/1 Fraction(); // generate a fraction which is 0/1. i.e...

  • Question 1 1 pts Which of the following is not a valid class name in Java?...

    Question 1 1 pts Which of the following is not a valid class name in Java? O MyClass MyClass1 My_Class MyClass# Question 2 1 pts Which of the following statements is False about instance variables and methods? Instance variables are usually defined with private access modifier. Instance variables are defined inside instance methods. Instance methods are invoked on an object of the class that contains the methods. A class can have more than one instance variables and methods. Question 3...

  • C++ Project Overview The 18th season of the reality series Hell's Kitchen began airing on Sep 28th, 2018 on Fox. Suppose you are working for the boss, Chef Gordon Ramsay, your job is to create an...

    C++ Project Overview The 18th season of the reality series Hell's Kitchen began airing on Sep 28th, 2018 on Fox. Suppose you are working for the boss, Chef Gordon Ramsay, your job is to create an efficient system that generates a menu. Since in Hell's Kitchen, menu changes every day, your system should easily add items to the menu. Therefore, dynamically allocated arrays would be an excellent solution. The Dish Class (Header File) You need to create a struct called...

  • Need to find the identity of the unknown compound using this information. Boiling point: 187 %C:...

    Need to find the identity of the unknown compound using this information. Boiling point: 187 %C: 79.37 %H: 8.88 Bromine test: no reaction Permanganate: no reaction Jones Oxidation: no reaction Sodium Hydroxide: no reaction 13C NMR Common Name: IUPAC Name: CAS No.: Zoom Out Solvent: BP: MP: 1.00 0.90 0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00 140 120 100 80 60 40 20 0 OK SAVE 1H NMR Common Name: IUPAC Name: CAS No.: Zoom Out Solvent: BP:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT