

Programming Random Numbers 9/18
Presentation
•
Computers
•
9th - 12th Grade
•
Practice Problem
•
Hard
Jalielle Curtis
FREE Resource
9 Slides • 10 Questions
1
By Jalielle Curtis
Follow along with the slideshow for today's lesson.
2
Multiple Choice
Rate Conversion: You have a bathtub that holds 50 gallons of water. Your tub faucet flows at a rate of 5.6 liters per minute. How long will it take to fill your bathtub? (Hint: look up what the conversion rate is - gallons to liters)
45 minutes
33.80 minutes
22.5 minutes
80.74 minutes
3
Multiple Choice
Rate Conversion: Joey Chestnut once at 121 Twinkies in 6 minutes. Given a constant rate of eating, how many Twinkies could he eat in 25 minutes and 17 seconds?(Rounded to the nearest whole number)
510 twinkies
251 twinkies
27 twinkies
1005 twinkies
4
Multiple Choice
The correct statement to print a statement to the console.
console.log("Hello World");
let name= readLine("What is your name? ");
console.log = readLine("Hello World");
let name = "Joe"
5
6
Multiple Choice
Random numbers from the random number generator are TRULY random.
True
False
7
Multiple Choice
Inclusive means that we include the edges.
True
False
8
Multiple Choice
What is the error in this statement:
let roll = randomizer.nextInt(1,6);
it should be .nextInteger
The range (1-6) should be surrounded by [] brackets
it should be .NextInteger
the R in Randomizer should be capitalized.
9
Multiple Choice
What is the correct method to call when you want a random decimal?
Randomizer.nextFloat();
Randomizer.nextdouble();
Random.Float();
None of these
10
2.6.2
11
Take a look at the Example 2.
This program uses a random number generator to simulate
rolling a six sided die. Can you change it to be an eight
sided die?
12
Open Ended
Copy and paste your new example code HERE:
13
Remember to use the Randomizer!
In this program, you will be randomizing the reward from finding a treasure chest.
Questions to consider:
Am I expecting an Integer or a Float (decimal)?
Do I need any variables? (yes, you should have the random number saved to the variable THEN console.log with that variable AND string.)
14
Reminders!
Make sure to READ the instructions on the assignment tag and follow them EXACTLY (variable names and all).
15
16
17
Open Ended
How is AI benefitting sports in all aspects? Give 3 examples.
18
Open Ended
Do you agree with use of AI in sports? Do you think it needs more regulation?
19
If you've already started working, implement some random numbers (look up math class).
Mini Cafe Cash Register Project!
2.1-2.5 Quizzes & Exercises
Watch videos if you have any unsurety about concepts.
Complete previous CodeHS modules
JavaScript Intro Activity
By Jalielle Curtis
Follow along with the slideshow for today's lesson.
Show answer
Auto Play
Slide 1 / 19
SLIDE
Similar Resources on Wayground
13 questions
Tennis Basics
Presentation
•
9th - 12th Grade
15 questions
Python
Presentation
•
10th - 12th Grade
14 questions
Infection Control: Hand Washing
Presentation
•
9th - 12th Grade
14 questions
Artigos definidos e Indefinidos - Inglês
Presentation
•
9th - 12th Grade
14 questions
Choosing between the passé composé and imparfait
Presentation
•
9th - 12th Grade
14 questions
Rational Functions - x&y intercepts & vertical asymptotes
Presentation
•
9th - 12th Grade
14 questions
Brushes, palettes, acrylic Questions
Presentation
•
9th - 12th Grade
15 questions
Solving Systems of Equations Review
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Safety Day 2026 – Student Review
Quiz
•
9th Grade
21 questions
Continents and Oceans
Quiz
•
6th Grade
20 questions
Parts of Speech
Quiz
•
5th Grade
16 questions
Subject & Predicate
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
Map Skills
Quiz
•
3rd Grade
22 questions
Continents and Oceans
Quiz
•
5th Grade
15 questions
Rounding Decimals
Quiz
•
5th Grade