Processing has functions that let you determine the time of day: second(), minute(), and hour(). You will use the minute and second functions to control a sketch with two items in it. Save the sketch with the name time.
Use the minute() function to control the position of one item.
Use the second() function to control the size of the other item.
The position and size changes must be evident. The fill color for the “seconds” indicator must not change.
For example, you might choose a triangle as the indicator for the minute, and move it vertically down the sketch as time progresses. You might choose an ellipse for the second indicator, and make it longer as the seconds progress. None of this requires the use of any conditionals (though if you do want to use conditionals for extra visual effect, feel free). Here are two further specifications which do require conditionals:
Change the background color of the sketch depending upon which quarter-minute it is: 0-14, 15-29, 30-44, 45-59.
Change the fill color of the minute indicator depending upon whether the minute is an even or odd number.
Although you are using the time functions, your sketch does not have to look like a clock. I don’t care if nobody can tell what time it is by looking at your sketch. It can be as representational or as abstract as you like, so be creative!
Here is an example; it is the clock as described above. Yours, of course, will look different.
How do you find out if a number is odd or even? You use the % operator. This gives you the remainder after division. For example, 17 % 3 gives you 2, because 17 divided by 3 is 5 with a remainder of 2.
Here’s the trick: if you divide a number by 2, you get a remainder of zero if the number is even, and a remainder of one if it’s odd. So this code will print the appropriate message:
int n = 27;
if (n % 2 == 0)
{
println("n is even");
}
else
{
println("n is odd");
}
I have this almost done, but I am having trouble with this if anybody could help me out. For the last step, the minute indicator needs to change color on even and odd minutes. I don't that is happening and shapes such as the rectangle is suppose to move right I don't understand how to do and the triangle is suppose to expand, which is not happening. So while the background is changing every 15 seconds the shapes are suppose to present while moving and changing colors but that is not happening. I am not sure what I am doing wrong.

I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!

@Daire here it is my question to what you were trying to ask.

`} else if (`) {```
}" Have a look at this if you are unsure: http://www.homeandlearn.co.uk/java/java_if_statements.html
Here is how you should end the 'if' statements:
else if (quarter == 3)
{
background(100,100,100);
}
------------------------------------------------------------
int x = second();
int n = 27;
if (x % 2 == 0)
{
fill(247, 5, 41);
triangle(200, 200, 180, 220, 220, 220);
}
else if (x % 2 == 1)
{
fill(29, 37, 224);
rect(20, 20, 60, 60);
}
}
I added the dashed line to indicate where you stop the background colour code and start the object code but you should leave this out of the actual code. The last part is not 100% but you have the right idea. Try to separate the code that handles the second object and the minute object. Have you learned about creating methods/functions? They're very useful for structuring your code.
You're on the right track. Keep it up!
```

```
```

```
```

```
```

```
```

```
```

```
```Looking for something else?

Not the answer you are looking for? Search for more explanations.

##
More answers

Looking for something else?

Not the answer you are looking for? Search for more explanations.

```
```