logo

Crowdly

Browser

Add to Chrome

A student writes this code to calculate the area of a rectangle and display it. ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

A student writes this code to calculate the area of a rectangle and display it. The program runs, but nothing appears on the canvas. What is the bug?

function setup() {

  createCanvas(300, 300);

  background(0, 255, 0);

}

function draw() {

  area(20, 5);

}

function area(w, h) {

  let result = w * h;

}

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on elearning.aua.am?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome