
8.1 Programming concepts Lesson Slides
Presentation
•
Computers
•
9th - 12th Grade
•
Medium
Adrian Ortiga
Used 6+ times
FREE Resource
23 Slides • 16 Questions
1
8.1 Programming concepts
Variables and Constants
By Adrian Ortiga
2
A programs needs to store data
For example:
The Grades of the students
The coins you have in Super Mario
Your username of Wechat account
3
Variables and Constant are use to store this data
666
X
4
Computer Memory, eg. RAM
Data
values
Memory
location
(address)
5
Each variable and constant is on a different memory location
we have number 10
In memory
location 0
6
Each Var and Const have an identifier (a name to find the value)
Here the identifiers are the memory location
7
Each Var and Const have an identifier (a name to find the value)
But we change it, to more meaningful names
8
Fill in the Blank
What is a named memory location that can store data, and the data can change while a program is running?
9
Fill in the Blank
What is a named memory location that can store data, but the data cannot change while a program is running?
10
Fill in the Blank
What is the name given to a variable, constant, data structure (like an array), or subroutine?
In order to identify memory address.
11
Multiple Choice
What is the difference between a constant and a variable?
12
Fill in the Blank
What is a type of programming statement that stores data in a variable or constant?
It is used to assign a value to a data address
13
Create, declare, define a variable
14
Create, declare, define a variable
Page 200
15
Common Variable Naming Conventions
(Rules for the names of variables.)
16
Multiple Choice
Which one of these is a valid variable name?
user-name
123name
user_name
name@user
17
Common Variable Naming Conventions
(Rules for the names of variables.)
18
Multiple Choice
Which variable name is NOT allowed?
firstPlace
_winner
2ndWinner
winner2
19
Common Variable Naming Conventions
(Rules for the names of variables.)
20
Multiple Choice
Which variable name is correct?
user name
username
user-name
user@name
21
Common Variable Naming Conventions
(Rules for the names of variables.)
22
Multiple Choice
Which is the best variable name for storing a person's age?
age
number1
a
temp
23
Common Variable Naming Conventions
(Rules for the names of variables.)
24
Multiple Choice
Which is an example of camelCase?
total_price
TotalPrice
totalPrice
totalprice
25
Common Variable Naming Conventions
(Rules for the names of variables.)
26
Multiple Choice
Which variable name is written like a constant?
max_speed
MaxSpeed
MAX_SPEED
maxSpeed
27
Common Variable Naming Conventions
(Rules for the names of variables.)
28
Multiple Choice
Which variable name is NOT a reserved keyword?
if
while
data
for
29
Common Variable Naming Conventions
(Rules for the names of variables.)
30
Multiple Choice
In most languages, what is true about Name and name?
They are the same.
They are different.
One is correct, one is wrong.
They are both wrong.
31
Common Variable Naming Conventions
(Rules for the names of variables.)
32
Multiple Choice
When is it okay to use very short variable names like i or j ?
In any program.
When naming user accounts.
Never.
Inside a small loop.
33
Common Variable Naming Conventions
(Rules for the names of variables.)
34
Multiple Choice
Why should you use the same style (like camelCase or snake_case) in your code?
To make it look cool.
To avoid errors.
To make the code easy to read.
Because the computer requires it.
35
Constants
Constants are the variables that CANNOT be changed.
36
Constants
Some programming languages like Python do not support CONSTANTS.
37
Data types
The data store in Variables and Constants can be of different types.
38
Data types
Page 202
39
Match
Match the following data with its data type
String
Integer
Real, single, double
Bolean
Char
"hello"
666
666.00
False
'h'
"hello"
666
666.00
False
'h'
8.1 Programming concepts
Variables and Constants
By Adrian Ortiga
Show answer
Auto Play
Slide 1 / 39
SLIDE
Similar Resources on Wayground
32 questions
CS Unit 7 T2 Robotics
Lesson
•
9th - 12th Grade
33 questions
Getting Started with Scratch
Lesson
•
9th Grade - University
31 questions
Naming Polynomials
Lesson
•
9th - 12th Grade
33 questions
Polyatomic Ions
Lesson
•
10th - 12th Grade
35 questions
Q2. Assessment 1 Practice: Quiz
Lesson
•
KG
33 questions
Projectile Practice Quiz
Lesson
•
9th - 12th Grade
35 questions
Stock Market: Ticker Symbols, Brands and Companies
Lesson
•
9th - 12th Grade
31 questions
Autentico Unit 3B Para mantener la salud
Lesson
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
14 questions
Boundaries & Healthy Relationships
Lesson
•
6th - 8th Grade
13 questions
SMS Cafeteria Expectations Quiz
Quiz
•
6th - 8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
12 questions
SMS Restroom Expectations Quiz
Quiz
•
6th - 8th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
10 questions
Pi Day Trivia!
Quiz
•
6th - 9th Grade
Discover more resources for Computers
10 questions
Pi Day Trivia!
Quiz
•
6th - 9th Grade
15 questions
Pi Day Trivia!
Quiz
•
9th Grade
15 questions
Pi Day Trivia
Quiz
•
9th - 12th Grade
10 questions
Understanding Pi and Its Applications
Interactive video
•
7th - 12th Grade
10 questions
Cell Organelles and Their Functions
Interactive video
•
6th - 10th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
5 questions
Did You Know? Ireland
Interactive video
•
9th - 10th Grade
10 questions
Exploring Basic Probability Concepts
Interactive video
•
6th - 10th Grade