
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 Blanks
9
Fill in the Blanks
10
Fill in the Blanks
11
Multiple Choice
What is the difference between a constant and a variable?
12
Fill in the Blanks
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
34 questions
Reviewing Networking
Presentation
•
9th - 12th Grade
31 questions
Intro Simple Harmonic Motion
Presentation
•
9th - 12th Grade
32 questions
N5 Database Design & Development Revision
Presentation
•
9th - 12th Grade
35 questions
Acids and Bases
Presentation
•
10th - 12th Grade
34 questions
ITX202 - Program Implementation Part 1
Presentation
•
8th - 12th Grade
33 questions
Exponential Functions Intro/Review
Presentation
•
9th - 12th Grade
36 questions
Act Science
Presentation
•
9th - 12th Grade
32 questions
Quadratic Equations by Graphing
Presentation
•
9th - 12th Grade
Popular Resources on Wayground
24 questions
PBIS-HGMS Day 10
Quiz
•
6th - 8th Grade
10 questions
HCS SCI 03 Summer School Review 3
Quiz
•
3rd Grade
11 questions
Home Scope
Quiz
•
7th - 8th Grade
15 questions
HCS SCI 05 Summer School Assessment 3 Review
Quiz
•
5th Grade
35 questions
Lufkin Road Middle School Student Handbook & Policies Assessment
Quiz
•
7th Grade
18 questions
Geo 11.3 Area of Circles and Sectors
Quiz
•
9th - 11th Grade