Assignment1.pdf - Assignment 1 Full Name Please write...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 1 Full Name:____________________________________________ Please write clearly and use extra sheets of paper as needed. Scans or good quality pictures of handwritten solutions are absolutely fine. Let Point be a simple class like Point(), Point(int x, int y), getX()/getY(), setX(int x), setY(int y) 1- Let reverse be a void method that takes as a parameter an array arr of object references and it reverses it. e.g. called with an array containing Points (1, 1), (2, 2) and (3, 3), modifies it to contain Points (3, 3), (2, 2) and (1, 1) ( the original point objects ). Let the code below be in the main : Point[] points = new Point[3]; points[0] = new Point(1, 1); points[1] = new Point(2, 2); points[2] = new Point(3, 3); reverse(points); Please draw a box and arrow diagram showing the state of all the variables before and after the method call ( no code; just the diagram ). Any objects should only be drawn once. References in the main should be in black. Any modified references (by the method) should be in red (or some other color). Variables that go out of scope when the method returns should be shown crossed out.
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern