
Variable Naming
Presentation
•
Computers
•
10th Grade
•
Practice Problem
•
Medium
Ryan Winton
Used 1+ times
FREE Resource
4 Slides • 5 Questions
1
Naming Variables
By Ryan Winton
2
Variables must have meaningful names.
Names that relate to the information/data they are storing.
A variable that stores the amount someone is paid per hour could be called payPerHour or pay_per_hour.
Meaningful
Variable Names
3
Naming Methods
Camel Casing
This name is given to the naming method where each new word in a variable name is given a capital letter (except the first word!).
payPerHour numberOfSubjects hoursWorked
Like a camel, these variable names have humps!
4
Naming Methods
Snake Casing
This name is given to the naming method where each new word in a variable name is separated by an underscore.
pay_per_hour number_of_subjects hours_worked
These variable names are like 1 long connected line like a snake!
5
Multiple Choice
Pick the example of Camel Casing
testScore
test_score
6
Multiple Choice
Pick the example of Snake Casing.
cube_volume
cubeVolume
7
Multiple Choice
Which of the following is not a suitable variable name?
test_score
TestScore
testScore
8
Multiple Choice
Which of the following is not a suitable variable name?
test_score
testscore
testScore
9
Open Ended
Give an example of a suitable name for a variable that is storing the number of subjects a pupil has taken.
Naming Variables
By Ryan Winton
Show answer
Auto Play
Slide 1 / 9
SLIDE
Similar Resources on Wayground
6 questions
Platforme educaționale
Presentation
•
9th Grade
6 questions
THE HUNDRED DRESSES
Presentation
•
10th Grade
6 questions
PSY-06-03-Experimental Design 2
Presentation
•
10th Grade
6 questions
Mini test 1 Vocabulary
Presentation
•
KG
9 questions
Animation Review
Presentation
•
9th Grade
10 questions
Linear Search
Presentation
•
9th - 10th Grade
8 questions
Year 11 - Diseases in Pregnancy
Presentation
•
10th Grade
8 questions
Are Facial Expressions Universal?
Presentation
•
10th Grade
Popular Resources on Wayground
15 questions
Grade 3 Simulation Assessment 1
Quiz
•
3rd Grade
22 questions
HCS Grade 4 Simulation Assessment_1 2526sy
Quiz
•
4th Grade
16 questions
Grade 3 Simulation Assessment 2
Quiz
•
3rd Grade
19 questions
HCS Grade 5 Simulation Assessment_1 2526sy
Quiz
•
5th Grade
17 questions
HCS Grade 4 Simulation Assessment_2 2526sy
Quiz
•
4th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
24 questions
HCS Grade 5 Simulation Assessment_2 2526sy
Quiz
•
5th Grade
20 questions
Math Review
Quiz
•
3rd Grade