logo

Crowdly

Browser

Додати до Chrome

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

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

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%
Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на elearning.aua.am?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!

Browser

Додати до Chrome