Code 04 Random Numbers

Code 04 Random Numbers

9th Grade

10 Qs

quiz-placeholder

Similar activities

WWW

WWW

6th - 10th Grade

15 Qs

Kiểm tra 15 phút - Tin học 12

Kiểm tra 15 phút - Tin học 12

9th - 12th Grade

10 Qs

S3 Computing Security Quiz

S3 Computing Security Quiz

KG - University

10 Qs

Google Earth Trivia

Google Earth Trivia

KG - Professional Development

10 Qs

IGCSE Comp Sci -  Security revision

IGCSE Comp Sci - Security revision

9th - 11th Grade

10 Qs

Structured information_E

Structured information_E

6th - 12th Grade

13 Qs

Graphics card

Graphics card

8th - 9th Grade

10 Qs

IMedia Recap

IMedia Recap

9th - 11th Grade

12 Qs

Code 04 Random Numbers

Code 04 Random Numbers

Assessment

Quiz

Computers

9th Grade

Hard

Created by

Tod Elford

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which block is used to generate random numbers in your programs?

randomNumber()

generateRandom()

randomValue()

numberRandom()

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What does the command randomNumber(1, 6) do?

Generates a random number between 1 and 6

Generates a random number between 0 and 5

Generates a random number between 1 and 5

Generates a random number between 0 and 6

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can random numbers be used in drawing commands?

As parameters to create random drawings

Only to set the color of shapes

Only to set the size of shapes

Only to set the border of shapes

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If you use randomNumber() multiple times in your program, what happens?

It generates new random numbers every time

It generates the same number every time

It generates numbers in a fixed sequence

It generates only one random number

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following best describes the use of randomNumber() in the command ellipse(randomNumber(0,400), 200);?

The x-coordinate of the ellipse is randomly chosen between 0 and 400

The y-coordinate of the ellipse is randomly chosen between 0 and 400

The size of the ellipse is randomly chosen between 0 and 400

The color of the ellipse is randomly chosen between 0 and 400

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why might each run of the command ellipse(randomNumber(0,400), randomNumber(0,400)); produce different results?

Because both coordinates are randomly generated each time

Because the color changes each time

Because the program uses a fixed sequence

Because the ellipse size is fixed

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of setting minimum and maximum values in randomNumber()?

To control the range of possible random numbers generated

To set the color of the random number

To fix the output to a single value

To repeat the same number every time

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?