![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 02.10.2020 21:01 cheyennebrooke01
(Geometry: point in a rectangle?)
Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the rectangle centered at (0, 0) with width 10 and height 5. For example, (2, 2) is inside the rectangle and (6, 4) is outside the rectangle, as shown in Figure 3.7b in the Programming Exercise from the Book section.
Hint: A point is in the rectangle if its horizontal distance to (0, 0) is less than or equal to 10 / 2 and its vertical distance to (0, 0) is less than or equal to 5.0 / 2. Test your program to cover all cases.
Sample Run 1
Enter the x-coordinate of the point: 2
Enter the y-coordinate of the point: 2
Point (2.0, 2.0) is in the rectangle
Sample Run 2
Enter the x-coordinate of the point: 6
Enter the y-coordinate of the point: 4
Point (6.0, 4.0) is not in the rectangle
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 09:00
Which is the highest level of the hierarchy of needs model? a. humanity b. intrapersonal c. team d. interpersonal
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 12:00
From excel to powerpoint, you can copy and paste a. cell ranges and charts, one at a time. b. cell ranges and charts, simultaneously. c. charts only. d. cell ranges only.
Answers: 3
![question](/tpl/images/cats/informatica.png)
You know the right answer?
(Geometry: point in a rectangle?)
Write a program that prompts the user to enter a point (x, y) and...
Questions
![question](/tpl/images/cats/es.png)
Spanish, 03.06.2020 08:57
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 03.06.2020 08:57
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 03.06.2020 08:57
![question](/tpl/images/cats/mat.png)
Mathematics, 03.06.2020 08:57
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 03.06.2020 08:57
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 03.06.2020 08:57
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
English, 03.06.2020 08:57
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 03.06.2020 08:57