Unit 1
Unit 2
Unit 3
Unit 5
Potpourri
100

What is 11110 in binary?

30

100

A(n) _________ is a precise sequence of instructions designed to complete a task

algorithm

100

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.

100

What UI Control do you use change the position of an image?

setPositon

100

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

200

Order from least to greatest:

0111, 0110, 0011, 1011

0011, 0110, 0111, 1011

200

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%

200

A repetition of a sequence of code is called a ______.

A loop

200

How do you create a button that takes you to a new screen?

  1. Go to design

  2. Drag button to screen

  3. Add new screen

  4. Name screen2

  5. Go to create

  6. On event “click”, “screen2”

  7. Setscreen “screen2”

200

Which of these defines a variable?

  1. var spoons = 7

  2. spoons = 8

  3. var spoons ==7

  4. var spoons

  5. spoons == 9

    a. var spoons =7

     d. var spoons

300

What is the Binary code 10101101 in Hexadecimal?

AD

300

If you have a canvas that is 30 x 30, how many bits would you need to encode a black and white image?

916

300

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.

300

A _________ compresses code and is called to make code shorter.

Function

300

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

400

What does DNS stand for?

Domain Name Server

400

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.

400

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.

400

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

400

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.

500

Explain one advantage of using binary for computers.

Easier to process for computers, simpler/less complex system

500

What is the best file format for a photograph and why?


  1. Png because it’s lossless compression will preserve every single pixel.

  2. Jpeg because it will efficiently compress the unneeded pixels in the image. 

  3. Gif because it can frame up to 256 unique colors and therefore keep the picture vibrant.

  4. 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. 

500

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.

500

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

500

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