Drawing four circles

Report a typo

Write a function that returns a buffered image of size 200x200. The image should have TYPE_INT_RGB color components, and it should contain four ovals of width and height 100 (i.e., circles) drawn in this exact order:

  • a red circle, at position (50, 50)

  • a yellow circle, at position (50, 75)

  • a green circle, at position (75, 50)

  • a blue circle, at position (75, 75)

The return value of the function should be a BufferedImage with the following contents:

A red circle, a yellow circle, a green circle, and a blue circle on the black background

Write a program in Kotlin
import java.awt.Color
import java.awt.image.BufferedImage

fun drawCircles(): BufferedImage {
// Add your code here
}
___

Create a free account to access the full topic