# Boolean and making titles

**URL:** https://discourse.processing.org/t/boolean-and-making-titles/10920
**Category:** Processing
**Tags:** homework
**Created:** [May 4, 2019, 9:01pm UTC](https://discourse.processing.org/t/boolean-and-making-titles/10920 "2019-05-04T21:01:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![elangit](https://avatars.discourse-cdn.com/v4/letter/e/ac8455/32.png) [@elangit](https://discourse.processing.org/u/elangit)
#### Post date: [May 4, 2019, 9:01pm UTC](https://discourse.processing.org/t/boolean-and-making-titles/10920/1 "2019-05-04T21:01:10Z")

</div>

So I need help for my homework, but for these steps I don’t understand what I am doing wrong and how to fix it. These functions are meant to get the information of the earthquakes and draw a popup with the indicated information when the mouse is over the circle.

```auto
boolean overCircle(int x, int y) {
  if (mouseX >= x+5 && mouseX <= x-5 && mouseY >= y+5 && mouseY <=y-5)
 return true; // always return true for now
}
/**
This function draws a popup rectangle containing the
title information of the given earthquake data.

parameters:
 - JSONObject datum: data on one earthquake
 - int x, int y: the location of the earthquake
 
returns void
*/
void drawPopup(JSONObject datum, int x, int y) {
  // TODO (HW problem 3) write your code here.  
  // Delete this comment when you are finished.
 if {boolean
   returns true 
  getTitle(datum);

```

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [May 4, 2019, 9:11pm UTC](https://discourse.processing.org/t/boolean-and-making-titles/10920/2 "2019-05-04T21:11:23Z")

</div>

Please don’t post the code as an image, post it as text

The command `return` leaves the function. Do you want this?

The function `getTitle()` should return a String, presumably from the Json? That’s what the title of the function **getTitle** suggests!

Anyway. The function `drawPopup()` should

- draw a rect (what you have in `getTitle()` now) and
- some text - use `fill()` and `text()`.
- See reference for those.

Chrisir
