

Programming Fundamentals
Presentation
•
Computers
•
8th Grade
•
Easy
Leslie Brazell
Used 3+ times
FREE Resource
19 Slides • 27 Questions
1
By Leslie Brazell
2
Interpreters - Interpreted Language
Translates and executes program code line by line into machine code.
ADVANTAGE: Easier to locate and fix errors.
DISADVANTAGE: Runs slower
** There are many, many different types of programming languages.
3
Compilers - Compiled Language
Translates, or “compiles” the entire code into machine code and then runs the program, or sets aside to run later.
ADVANTAGE: Runs faster
DISADVANTAGES: Harder to locate and fix errors.
4
Multiple Choice
What is an advantage of interpreted language
It runs fast
It is easy to correct an error
5
Multiple Choice
What is an advantage of compiled language
It runs fast
It is easy to correct an error
6
Multiple Choice
Which type of programming language translates the entire code before running any of the instructions/steps?
compiled
interpreted
scripting
markup
7
Multiple Choice
Which type of programming language translates and executes program code line by line into machine code?
compiled
interpreted
scripting
markup
8
NAMING RULES
Basic Guidelines:
Use descriptive names
No spaces
camelCase (Start with lowercase letter and every next word starts with a capital letter)
Cannot start with a number
Names are case sensitive!
9
Multiple Choice
Which of the following is an example of camel case?
partOfday
partOfDay
PartOfDay
PartofDay
10
11
12
13
Multiple Choice
Which type of language uses a series of commands?
HTML
Query
Scripting
Compiled
14
Multiple Choice
Which type of language is used to design web pages?
HTML
Query
Scripting
Compiled
15
Multiple Choice
Which type of language is used in databases?
HTML
Query
Scripting
Compiled
16
Data Types
integer - contains a number. The number can be positive, negative, or zero. It cannot have a decimal component. (EX: -50, 0, 5)
string - contains text, or a sequence of letters, numbers, punctuation, spaces, etc. (EX: "Hello", world!", "abc123")
char (short for character) - contains a single character or punctuation. (EX: a, z, 1, !, #)
Boolean - binary and evaluates to either true or false. (EX: true, false)
17
Multiple Choice
Which data type contains text, or a sequence of letters, numbers, punctuation, spaces, etc.?
integer
string
char
Boolean
18
Multiple Choice
Which data type contains a single character or punctuation?
integer
string
char
Boolean
19
Multiple Choice
Which data type contains a number that can be positive, negative, or zero but cannot have a decimal component?
integer
string
char
Boolean
20
Multiple Choice
Which data type is binary and evaluates to either true or false?
integer
string
char
Boolean
21
Variables - can change
var myFavoriteNumber = 24;
myFavoriteNumber = 12;
println(myFavoriteNumber);
output
12
22
constant - can NOT change
var myFavoriteNumber = 24;
myFavoriteNumber = 12;
Error Line 2:
Uncaught TypeError: Assignment to constant variable
23
Multiple Choice
What keyword do you need to use to define a variable in JavaScript?
variable
var
const
x
24
Multiple Choice
What will be printed as a result of the following code segment?
var firstPlace = "Dylan";
var secondPlace = "Jacob";
firstPlace = "Jacob";
secondPlace = "Julia";
println(firstPlace);
println(secondPlace);
Jacob
Dylan
Jacob
Julia
Julia
Jacob
Dylan
25
Multiple Choice
A store has 30 backpacks. How can you store this information in a JavaScript variable?
var num backpacks = 30;
20 = numBackpacks;
var numBackpacks = 30;
var numBackpacks ==30;
26
How to write a karel command
move( );
No spaces in commands
Need to match exact capitalization
Every command ends in ( );
27
Multiple Choice
Which of these is a valid Karel command?
turnleft( );
TurnLeft( );
turnLeft( );
(turnLeft);
28
Functions are a way to teach Karel a new command (word).
Functions allow us to
Break our program into smaller parts
Make the program easier to understand
Avoid repeating code over and over
29
calling "turn around"
Define "Turn around"
​function turnAround() { turnLeft(); turnLeft(); }
turnAround();
turnRight();
move();
Defining a function - Writing out the instructions for this new action
Calling a function - Actually causing the action to happen
30
Multiple Choice
Which of the following is an example of defining a function?
function backflip( ) {
turnLeft( );
turnLeft( );
turnLeft( );
turnLeft( );
backflip( );
31
Multiple Choice
Which of the following is an example of calling a function?
function backflip( ) {
turnLeft( );
turnLeft( );
turnLeft( );
turnLeft( );
backflip( );
32
Multiple Choice
Functions are a way to teach Karel a new command.
True
False
33
Multiple Choice
Which function will teach Karel how to spin in a circle one time?
function spin() { turnRight();
}
function spin() { turnLeft(); turnLeft(); turnLeft(); turnLeft();
}
function spin() { turnLeft(); turnLeft();
}
function spin() { move(); move(); move(); move();
}
34
For Loops - For loops let Karel repeat a section of code a fixed number of times
While Loops - While loops allow us to repeat a section of
code as long as some condition is true.
for(var i = 0; i < count; i++) {
/* code to execute count times */ }
// This places ten balls down
for(var i = 0; i < 10; i++)
{ putBall(); }
while(condition) {
/* code to repeat */
}
while(frontIsClear()) { move();
}
35
ALL programming has FOR LOOPS
Repeat as long as condition is true.
Repeat for an undetermined number of times.
For Loops
While Loops
Repeat fixed number of times
Repeat as long as condition is true
36
move( ); five times
to FOR LOOPS
function start ( ){
move( );
move( );
move( );
move( );
move( );
}
for (var i = 0; i < 5; i++) {
move( );
}
37
if/else statements
An if-else statement runs some code if a condition is true,
and a different block of code if that condition is false.
This IF/ELSE statement tells Karel to move forward if it is clear (nothing blocking his way).
Else (if something is blocking his way) he will turn left.
if(frontIsClear( )) {
move( );
} else {
turnLeft( );
}
38
Multiple Choice
What is the best way for Karel to move 10 times?
move(); move(); move(); move(); move(); move(); move(); move(); move(); move();
for (var i = 0; i < 10; i++)
{ move();
}
move(10);
move10();
39
Multiple Choice
What does an if/else statement look like in JavaScript?
if (condition) { //code
}
for (var i = 0; i < count; i++) { //code
}
if (condition) { //code }
if (condition) { //code
}
if (condition) { //code
} else {
//code
}
40
Multiple Choice
Why do we use if/else statements in JavaScript?
To repeat something for a fixed number of times
To do something if a condition is true and do something else if the condition is false
To break out of some block of code
To repeat something while a condition is true
41
Multiple Choice
If you want to write a program to have Karel put down 50 tennis balls. Which control structure would you use?
If statement
While statement
For loop
Nested while loop
42
A fixed container that stores an ordered collection of items.
array -
Shopping List
bread eggs milk cookies
0 1 2 3
var shoppingList =
["bread", "eggs",
"milk", "cookies"];
println(shoppingList)[1] );
eggs
43
Multiple Choice
Given the following list, what would the output be?
var travelList = [Alaska, Australia, Ireland, Argentina];
println(travelList [3]);
Alaska
Australia
Ireland
Argentina
44
Multiple Choice
What is an array?
a collection of items stored at (row, column) locations.
an unordered collection of unique items.
a collection of (key, value) pairs.
an ordered collection of items.
45
Multiple Choice
In the following array, which of the following statements will change "Argentina" to "Peru"?
var travelList = [Alaska, Australis, Ireland, Argentina];
travelList ["Argentina"] = Peru;
travelList[4] = "Peru";
travelList[3] = "Peru";
travelList change [1] = "Peru";
46
Some text here about the topic of discussion
code - a term used in programming for the set of instructions that can be run or executed by a computer.
condition - is code that you put inside an if statement or while-loop.
object - can store combinations of keys and values where the value can be accessed by its associated key. Resizable - One data type
By Leslie Brazell
Show answer
Auto Play
Slide 1 / 46
SLIDE
Similar Resources on Wayground
41 questions
Wie is het?
Presentation
•
KG
41 questions
Hackers Listening Chapter 3 Test
Presentation
•
8th Grade
39 questions
LIght technology
Presentation
•
8th Grade
40 questions
The Progressive Era
Presentation
•
8th Grade
42 questions
Structure & Function of Matter Review
Presentation
•
8th Grade
43 questions
Superposition Notes
Presentation
•
8th Grade
39 questions
Biology STAAR Review - 4B Cell Transport
Presentation
•
9th Grade
41 questions
Rivers and Streams Self-paced lesson
Presentation
•
8th 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