It's UWAweek 16 (1st semester, week 7)

help2005

This forum is provided to promote discussion amongst students enrolled in CITS2005 Object Oriented Programming.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying selected article
Showing 1 of 49 articles.
Currently 1 other person reading this forum.


 UWA week 16 (1st semester, week 7) ↓
SVG not supported

Login to reply

👍x1
helpful
11:00am Mon 15th Apr, ANONYMOUS

Hi, I having trouble wrapping my head around the given answer for this question on the lms. Specifically, the part about checking if a point is within a rectangle as this is the Boolean used: return x >= this.x && x <= this.x+width && y >= this.y && y <= this.y+height; In this case above I tried running the example (-1,1) within a rectangle with dimensions: x = -2, y =2, height = 2 and width = 2. -1 >= -2 is True -1 <= -2+2 is True 1 >= 2 FALSE **********************(This is the part I'm having an issue with) 1 <= 2+2 True The point (-1,1) should be within a rectangle with these parameters correct? Or have I misinterpreted this question?

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy