3.2.2 Mouse Press Events and onAppStart Function

3.2.2 Mouse Press Events and onAppStart Function

11th Grade

10 Qs

quiz-placeholder

Similar activities

Avaliação 1T - JavaScript

Avaliação 1T - JavaScript

9th - 12th Grade

10 Qs

History of Computing, Hardware, and Software

History of Computing, Hardware, and Software

8th - 11th Grade

12 Qs

1.1.1 CSE App Inventor

1.1.1 CSE App Inventor

9th - 12th Grade

12 Qs

Python L2- Quiz 4

Python L2- Quiz 4

5th - 12th Grade

6 Qs

CAT G11 Module 2 AMA Quiz

CAT G11 Module 2 AMA Quiz

11th Grade

10 Qs

Warm Up - CAI711

Warm Up - CAI711

11th - 12th Grade

10 Qs

Solar2D Review

Solar2D Review

10th Grade - University

14 Qs

Unit 6 Review

Unit 6 Review

9th - 12th Grade

10 Qs

3.2.2 Mouse Press Events and onAppStart Function

3.2.2 Mouse Press Events and onAppStart Function

Assessment

Quiz

Computers

11th Grade

Easy

Created by

Christina LaBarron

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the onAppStart(app) function in the given code example?

It runs continuously in the background.

It is called exactly once when the app starts.

It is used to draw shapes on the screen.

It handles mouse click events.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In the code example, what values are set for app.rectLeft and app.rectTop in the onAppStart function? Fill in the blank: app.rectLeft is set to ___ and app.rectTop is set to ___.

A) 50, 100

B) 100, 200

C) 200, 300

D) 0, 50

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the purpose of the onMousePress function in the given code snippet?

To draw a rectangle

To detect mouse clicks and report their location

To import graphics library

To start the application.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

In the code snippet, the onMousePress function updates the values of app.rectLeft and app.rectTop based on the location of the mouse press. Fill in the blank: The values are updated to _______.

100, 200

mouseX, mouseY

50, 50

0, 0

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the function def onAppStart(app): in the code?

It is called every time the mouse is pressed.

It sets the initial values of app.rectLeft and app.rectTop.

It draws the rectangle on the screen.

It clears the canvas.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Fill in the blank: The function def onMousePress(app, mouseX, mouseY): is used to update the position of the rectangle. The variable app.rectLeft is updated to the value of _______.

mouseX

mouseY

app.rectTop

app.rectLeft

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What should you avoid naming your own values in the app object to prevent conflicts with reserved dimensions?

A) width and height

B) length and breadth

C) size and scale

D) x and y

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?