Test Review
Part 1: On the test you will need to be able to recognize samples of the following programming languages:
1. HTML
2. CSS
3. JavaScript
4. Python
5. Microsoft Small Basic
To prepare for this section of the test, please review the program tutorials used during the semester.
1. HTML
2. CSS
3. JavaScript
4. Python
5. Microsoft Small Basic
To prepare for this section of the test, please review the program tutorials used during the semester.
Part 2: Know the vocabulary for the following programming terms.
A variable stores a piece of data, and gives it a specific name. For example cats = 5
A Boolean is like a light switch. It can only have two values. Just like a light switch can only be on or off, a Boolean can only be True or False.
A comment is a line of text that won't run as code. It's just for humans to read. A comment in JavaScript uses //, while a comment in Python uses #.
A modulo returns the remainder from a division. So, if you type 3 % 2, it will return 1, because 2 goes into 3 evenly once, with 1 left over.
What are three examples of data types? number, string, and Boolean
A string can contain letters, numbers, and symbols. Strings need to be within quotes
An integer is a whole number (not a fraction and no decimal points) that can be positive, negative, or zero. We used them in for loops and while loops to increment numbers.
A function is a block of code designed to perform a particular task. Once a function is written, it can be used over and over again. Most programming languages provide many built in functions that would otherwise require many steps to accomplish.
A parameter or "argument" is a value that is passed into a function. In the line of JavaScript code below, the four pieces of information inside the parentheses are the four parameters that make an ellipse.
ellipse (200,200, 50,50);
HTML stands for Hyper Text Markup Language.
CSS stands for Cascading Style Sheets.
A variable stores a piece of data, and gives it a specific name. For example cats = 5
A Boolean is like a light switch. It can only have two values. Just like a light switch can only be on or off, a Boolean can only be True or False.
A comment is a line of text that won't run as code. It's just for humans to read. A comment in JavaScript uses //, while a comment in Python uses #.
A modulo returns the remainder from a division. So, if you type 3 % 2, it will return 1, because 2 goes into 3 evenly once, with 1 left over.
What are three examples of data types? number, string, and Boolean
A string can contain letters, numbers, and symbols. Strings need to be within quotes
An integer is a whole number (not a fraction and no decimal points) that can be positive, negative, or zero. We used them in for loops and while loops to increment numbers.
A function is a block of code designed to perform a particular task. Once a function is written, it can be used over and over again. Most programming languages provide many built in functions that would otherwise require many steps to accomplish.
A parameter or "argument" is a value that is passed into a function. In the line of JavaScript code below, the four pieces of information inside the parentheses are the four parameters that make an ellipse.
ellipse (200,200, 50,50);
HTML stands for Hyper Text Markup Language.
CSS stands for Cascading Style Sheets.
Part 3: Programming Terms in Action
Q. food = “cheese” What would “cheese” be an example of?
A. Since "cheese" is inside quotation marks, it would be a string.
Q. answer = True What would True be an example of?
A. a Boolean
Q. Can you give three examples of a Boolean?
A. True or False (3 < 4) and (5 >= 5) this() and not that()
Q. cats = 24 What would 24 be an example of?
A. an integer or whole number
Q. In the above two examples, what would food and cats be examples of?
A. variables
Q. The four examples below are examples of what?
3 < 4 5 >= 5 10 == 10 12 != 13
A. comparators
Q. What is the term for the information that goes inside parentheses? For example,
x = sumAll(51, 23, 50, 15, 34, 18);
A: Parameters
Q. food = “cheese” What would “cheese” be an example of?
A. Since "cheese" is inside quotation marks, it would be a string.
Q. answer = True What would True be an example of?
A. a Boolean
Q. Can you give three examples of a Boolean?
A. True or False (3 < 4) and (5 >= 5) this() and not that()
Q. cats = 24 What would 24 be an example of?
A. an integer or whole number
Q. In the above two examples, what would food and cats be examples of?
A. variables
Q. The four examples below are examples of what?
3 < 4 5 >= 5 10 == 10 12 != 13
A. comparators
Q. What is the term for the information that goes inside parentheses? For example,
x = sumAll(51, 23, 50, 15, 34, 18);
A: Parameters
Part 4: Other
Know what the following three lines of code would do in an HTML document.
1. <img src="http://cute-dogs.jpg"/> (Places an image of a cute dog on the web page.)
2. <a href="http://mrmanion.weebly.com"> <img src="http://computer.jpg"/> </a> (Click on the image of a computer that links to my website.)
3. <a href="http://mrmanion.weebly.com"> Mr. Manion's Website </a> (Click on the words "Mr. Manion's Website" that are linked to my site.)
Understand how a list index works. A list index begin with 0, not 1!
Q. Look at the two lines of code below. What number would be printed?
numbers = [8, 9, 10, 11]
print numbers[1] + numbers[3]
A. 20
Q. Look at the code below that contains a list of colors. What color would be printed?
index_colors = ["red", "green", "yellow", "blue"];
print index_colors[3]
A. blue
Q. Look at the code below that contains a list of lunch sack items. What two numbers would you replace the two question marks with if you wanted to access just the chips and carrots from the first line of code?
lunch = ["apple", "sandwich", "granola bar", "chips", "carrots", "candy bar"]
middle = lunch[?:?]
A. 3:5
Q. For drawing in JavaScript, use the graph to the right to determine where the following coordinates would be located based on a screen that is 400 pixels across by 400 pixels down. Remember that x goes across and y goes down. (x,y) I have done the first couple for you.
(0,0) ___(Location: Top Left)________
(0,400) _(Location: Bottom Left)______
(400, 0) _______________________
(400,400) _____________________
(200,200) _____________________
Q. How does a for loop work? Make sure you understand this.
for (var counter = 0; counter < 101; counter+=3) {
console.log(counter);
}
A. Let's break down the above for loop.
var counter = 0; means that we will start counting at 0.
counter < 101; means that we will count up to 100.
counter +=3 means that we will count by an interval of 3
console.log(counter): means we will print 0 to 100 by 3s.
Know what the following three lines of code would do in an HTML document.
1. <img src="http://cute-dogs.jpg"/> (Places an image of a cute dog on the web page.)
2. <a href="http://mrmanion.weebly.com"> <img src="http://computer.jpg"/> </a> (Click on the image of a computer that links to my website.)
3. <a href="http://mrmanion.weebly.com"> Mr. Manion's Website </a> (Click on the words "Mr. Manion's Website" that are linked to my site.)
Understand how a list index works. A list index begin with 0, not 1!
Q. Look at the two lines of code below. What number would be printed?
numbers = [8, 9, 10, 11]
print numbers[1] + numbers[3]
A. 20
Q. Look at the code below that contains a list of colors. What color would be printed?
index_colors = ["red", "green", "yellow", "blue"];
print index_colors[3]
A. blue
Q. Look at the code below that contains a list of lunch sack items. What two numbers would you replace the two question marks with if you wanted to access just the chips and carrots from the first line of code?
lunch = ["apple", "sandwich", "granola bar", "chips", "carrots", "candy bar"]
middle = lunch[?:?]
A. 3:5
Q. For drawing in JavaScript, use the graph to the right to determine where the following coordinates would be located based on a screen that is 400 pixels across by 400 pixels down. Remember that x goes across and y goes down. (x,y) I have done the first couple for you.
(0,0) ___(Location: Top Left)________
(0,400) _(Location: Bottom Left)______
(400, 0) _______________________
(400,400) _____________________
(200,200) _____________________
Q. How does a for loop work? Make sure you understand this.
for (var counter = 0; counter < 101; counter+=3) {
console.log(counter);
}
A. Let's break down the above for loop.
var counter = 0; means that we will start counting at 0.
counter < 101; means that we will count up to 100.
counter +=3 means that we will count by an interval of 3
console.log(counter): means we will print 0 to 100 by 3s.