Binary Basics
Compression Concepts
Programming Principles
Internet Infrastructure
Error and Overflow
Code Tracing with Conditionals
Potpourri
100

This is the decimal equivalent of the binary number 1010.

What is 10?

100

This type of compression allows for perfect reconstruction of the original data.

What is lossless compression?

100

This programming method executes code in response to user actions.

What is event-driven programming?

100

This is the purpose of the Transmission Control Protocol (TCP).

What is track IP packets to make sure all arrive and are in the proper order? 

100

This is an example of overflow error in computing.

Various Responses... 
100

This will be the outcome of the following code:

var x = 10

if x > 5:

    print("Greater")

else:

    print("Smaller")


What is "Greater"?

100

This is 1 % 5.

What is 1?

200

This many numbers can be represented using a 6-bit binary system.

What is 64?

200

This is why lossy compression is often used for image files.

Why is:

- Lossy compression often compresses files to smaller sizes.  

200

This line of code is most likely to cause a syntax error: 

var x = 5, 

console.log(x), 

if x = 5, 

x++?

what is

if x = 5

?

200

This is how metadata is used in data packets.

What is provide to and from IP addresses and packet order and number information?

200

This decimal number causes overflow in a 4-bit binary system.

What is anything over 15?

200

The following code will print what if the input is 7? var input = promptNum("Enter a number: "));

if (input % 2 == 0){    
   console.log("Odd");
} else {
   console.log("Even");
}

What is "Even"?  (The programmer needs to fix this code...)

200

This is displayed after the code is run:

list ⬅ [5, 8, 7, 5]
buzz ⬅ 0
FOR EACH value IN list
{
  if( value > 7 )
  {
    buzz ⬅ buzz + 1
  }
}
DISPLAY( buzz )

What is 1?

300

This is the decimal number 45 converted to binary.

What is 101101?

300

This is an example of when lossless compression would be essential.

Various Correct Responses...

300

This is why comments are used in code.

What is helps the reader of the code better understand what's going on? 

300

This principle allows a network to continue functioning if part of it fails.

What is fault tolerance?

300

This is the difference between overflow and round-off errors.

What is:

-Overflow is when you have too few bits to represent a value.

-Roundoff is when a number is too small to represent accurately.

300

Given the following code, this is the value of y:

var x = 3;
var y = 0;

if (x < 5){
   y = x * 2
}else {
   y = x + 2;
}

console.log(y);


What is 6?

300

This is an outcome of the Digital Divide.

What is lack of access to the internet.

400

This is the largest of the following in binary: 110110, 111011, 101010.

What is 111011?

400

This compression algorithm typically reduces file sizes more significantly.

What is a lossy compression algorithm?

400

This will be the outcome of this code:

var x = 3
var y = 5
var z = 2

console.log((x + y)%z);

What is 0?

400

This is how scalability impacts the performance of a network.

What is as a network grows, the network works in the same way.

400

This is why using more bits in a system reduces errors.

What is there will be less of a chance of having overflow errors? 

400

This will be the outcome of this code:

var counter = 7;
evenOdd();
console.log(counter);

function evenOdd() {
   for(var i = 0; i < 3; i++) {
      var counter++;
   }

}

What is the code won't run?

400

These are 3 causes of the digital divide.

What are:

- Inability to afford internet access.
- Living in an area where internet access does not exist.
- Lack of knowledge of how to use a device to access the internet.
- Physical disability that makes using a device to access the internet impossible

500

This happens when a number exceeds the storage capacity of a 5-bit system.

What is an overflow error?

500

This is the key trade-off of lossy compression.

What is good file size reduction but no ability to reconstruct the data to its original value?
500

This will be the outcome from running this code:

var numList = [2, 3, 20, 18];

if(numList[2] % numList[1] <= numList[0]){            console.log(numList[3]);
}else {
   console.log(numList[1]+numList[2];
}

What is 18?



500

This is the role of an IP address in internet communication.

What is allowing communication between machines on the internet by giving each machine its own address?

500

The numbers 7 and 8 are added together. The value is then stored in 4 bits. 

This is the outcome of this process.

What is the value 15 is accuratley represeented.

500

This will be the value of thud when the program finishes running. 

values ⬅ [5, 12, 1, 0, 10, 4, 1]
thud ⬅ 0
baz ⬅ 0
FOR EACH value IN values
{
  baz ⬅ baz + 1
  if( value ≤ 4 )
  {
    thud ⬅ baz
  }
}
DISPLAY( thud )

What is 7?

500

This is why Mr. Stansbery is so awesome.

Various Answers... 

M
e
n
u