What is 11110 in binary?
30
A(n) _________ is a precise sequence of instructions designed to complete a task
algorithm
When is it more effective to use a function rather than a loop?
A function should be used to do a specific task and can be used in the program more than once. A loop should be used to do a simpler task or a function multiple times in a repetitive sequence in order to achieve a task.
What UI Control do you use change the position of an image?
setPositon
What is the original text from this compressed text:
-----------------------------
Dictionary:
#: he
☀: ll
★: un
☾: tt
♡: and
------------------------------
T#_li☾le_kids_have_f★_in_t#_s★_while_
eating_c♡y_♡_ge☾ing_s♡y
The_little_kids_have_fun_in_the_sun_while_eating_candy_and_getting_sandy
Order from least to greatest:
0111, 0110, 0011, 1011
0011, 0110, 0111, 1011
The original size of a text is 63 bytes. The compressed version of the text is 17 bytes with a 24 byte dictionary. Find the compression rate of the text.
35%
A repetition of a sequence of code is called a ______.
A loop
How do you create a button that takes you to a new screen?
Go to design
Drag button to screen
Add new screen
Name screen2
Go to create
On event “click”, “screen2”
Setscreen “screen2”
Which of these defines a variable?
var spoons = 7
spoons = 8
var spoons ==7
var spoons
spoons == 9
a. var spoons =7
d. var spoons
What is the Binary code 10101101 in Hexadecimal?
AD
If you have a canvas that is 30 x 30, how many bits would you need to encode a black and white image?
916
What does selection mean in the coding world?
A generic term for a type of programming statement (usually an if-statement) that uses a Boolean condition to determine, or select, whether or not to run a certain block of statements.
A _________ compresses code and is called to make code shorter.
Function
What would be written in the console log at the end of this program?
var a = 7;
var b = 2;
var c = 5;
b = a + 4;
a = b;
c = a - 2;
console.log (b);
console.log (c);
console.log (a);
11
9
11
What does DNS stand for?
Domain Name Server
What is the difference between lossless and lossy compression? Provide 1 example of each and explain each of their applications/benefits.
Lossless: data can be pieced together without missing parts; perfectly matches the original.
E.x. PNG, WAV
Application: used when a high degree of accuracy and clarity is needed
Lossy: a form of compression in which bits are removed to decrease file size; cannot be reformed to original.
E.x. JPEG, MP3
Application: where the human eye cannot detect any differences.
What is the best way to title a function and why?
Camelcase is the best way to tile a function because of its easy to read but it only uses letters which makes sure the program doesn’t crash. It is also very easy to keep track of and remember.
What are the values of each variable after execution?
Var x = 7
Var b = 13
Var a = 2
A = x +b
X = b * a
B = x/40
A = 20
X = 260
B = 6.5
Why is it important to give the different parts of the code descriptive names?
It is important to do this because it makes it much easier to put things into the code that are easy to understand and follow. It also makes coding go by quicker because you don’t have to keep looking back at the design tab to know what each component is.
Explain one advantage of using binary for computers.
Easier to process for computers, simpler/less complex system
What is the best file format for a photograph and why?
Png because it’s lossless compression will preserve every single pixel.
Jpeg because it will efficiently compress the unneeded pixels in the image.
Gif because it can frame up to 256 unique colors and therefore keep the picture vibrant.
Zip because it will break up the image into efficient parts of pixels and keep it in a single accessible “folder” file.
Jpeg because it will efficiently compress the unneeded pixels in the image.
Name what a low level programming language would generally consist of, and name what a high level programming language would generally consist of. Then, clearly establish which programming language is more superior than the other and why.
Low level: Raw, binary data
High level: Variables, boolean expressions
Ex. High level programming languages are more superior than low level programming languages because it allows the user to easily and more efficiently code a complex algorithm.
How should the buttons be labeled
a)similarly
b)clearly and easy way to remember
C)number
D)random
clearly and easy way to remember
If you have 27 students in your class, what is the minimum number of bits you would need encode one third of the students.
5