Abstraction
binary
For loops & If-else statements
Code comprehension
100

Abstraction is the core components of a program and focusing on the ________ concept(s).


A. general

B. side

C. less important

what is A. General

100

The binary system is often described as "Base-2." What are the only two symbols used in this system to represent all data?
A) 1 and 2
B) 0 and 1
C) A and B
D) + and -

what is 0 and 1

100
What type of loop is best used to iterate over a list?


A. While

B. FOR EACH

C. Continuous

B. FOR EACH

100

Which of the following will the code print:

a ← 10

b ← 15

c ← a

a ← 20

c ← b

DISPLAY(a)

DISPLAY(c)


A) 10 10
B) 10 15
C) 20 10
D) 20 15

What is D) 20 15

200

What part of flipping on a light switch would abstraction hide?

A. The light turning on

B. The wiring, circuits, and voltage behind the switch

C. Being able to see your surrounding

what is B. The wiring, circuits, and voltage behind the switch

200

What is the decimal (Base-10) equivalent of the binary number 1011?
A) 3
B) 9
C) 11
D) 13

what is 11

200

How many time do FOR EACH loops run?

A. Until the user inputs stop

B. Once

C. For each item in the entire list

what is C. For each item in the entire list

200

rate - 20

hours - 50

totalpay - 0

overtimepay - 0

If hours > 50:

        Display("You earned overtime pay")

else

        Display("Regular pay = $5, hours * rate")


A) you earned overtime pay.

B. Regular Pay = $50 * 20

C. 400

D. Regular pay = $400

what is "you earned overtime pay."

300

Which of the following list of hardware go from least to most abstract.

A. Truth table, logic gate diagram, circuit diagram

B. Truth table, circuit diagram, logic gate diagram

C. Circuit diagram, Truth table, logic gate diagram

D. logic gate diagram, Truth table, circuit diagram

what is C. Circuit diagram, Truth table, logic gate diagram

300

A computer system uses 5 bits to represent unique ID numbers for students. If the school grows and needs to assign unique IDs to 40 students, what is the minimum number of bits now required?
A) 5 bits
B) 6 bits
C) 7 bits
D) 8 bits

what is 6 bits

300

If-else statements compute a block of code based off each element in a list.

A. True

B. False

what is B. False

300

What will the variable num equal after the following code executes?

num ← 0 

REPEAT 3 TIMES 

{   

      num ← num + 5 

num ← num * 2


A) 10
B) 15
C) 25
D) 30

what is D) 30

400

how do parameters provide abstraction.

A. They hide false input values

B. They allow software reuse for different values

C. They return values from procedures to the calling program

what is B. They allow software reuse for different values

400

A certain program uses a 4-bit unsigned integer system (maximum value of 15). What occurs if the program attempts to add the decimal values 12 and 7?
A) A round-off error occurs because the result is a fraction.
B) An overflow error occurs because the sum exceeds the 4-bit limit.
C) The computer automatically adds a 5th bit to store the result of 19.
D) The program converts the numbers to hexadecimal to avoid an error.

what is An overflow error occurs because the sum exceeds the 4-bit limit.

400

For a block of code under an ELSE statement to compute, what criteria must be met?

A. True

B. Repetetive

C. False

What is C. False

400

What will be the value of count after the following code runs?

count ← 0 

numbers ← [1, 3, 5, 2, 4] 


FOR EACH n IN numbers 

{   

       IF (n > 2)   

       {      

            count ← count + 1   

       }   

       ELSE   

       {      

             count ← count - 1   

       } 

DISPLAY(count)

A) 1
B) 2
C) 3
D) 5

what is A) 1

500

Which of the following is a example of coding related abstraction?

A. Typing comments into your code

B. The CPU

C. Machine learning

D. Pressing a button

What is D. Pressing a button

500

A network administrator is assigning IP addresses and needs to convert the decimal number 214 into an 8-bit binary byte. What is the correct binary representation of 214?

A) 11010110
B) 11101010
C) 10110110
D) 11011011

what is 1010110

500

What will the code print.

week - False

weekend - True

If weekday == true:

        print("it is still the week.")

else:

        print("It is the weekend!")

What is "it is the weekend!"

500

What will be displayed after the following code runs?

a ← 20 

b ← 1 

WHILE (a > b) 

{   

       IF (a MOD 3 = 0)   

       {      

        a ← a - 5   

       }   

       ELSE   

       {      

        a ← a - 3   

        }   

         b ← b + 2 

DISPLAY(a)


A) 8
B) 9
C) 11
D) 12

What is 9

M
e
n
u