Comp Thinking Exam

studied byStudied by 1 person
0.0(0)
learn
LearnA personalized and smart learning plan
exam
Practice TestTake a test on your terms and definitions
spaced repetition
Spaced RepetitionScientifically backed study method
heart puzzle
Matching GameHow quick can you match all your cards?
flashcards
FlashcardsStudy terms and definitions

1 / 20

encourage image

There's no tags or description

Looks like no one added any tags here yet for you.

21 Terms

1

Conversion between decimal and binary number system

0 is off, 1 is on, all of the zeroes and exponents can make numbers by adding, Bit (1), Bite (8), kilobite (1000), megabite (10000), gigabite (100000), terabite (1000000), decimal is normal, binary is 0s and 1s

New cards
2

Can you identify AND, OR, and NOT logic gates?

If “and” is shown, and 1 is true and the other is true, it is true. If one or two is false, the statement is false

If “or” is shown, and 1 or more is true, then the statement is true. If both statements are false, then the whole statement is false

“Not” negates a statement

New cards
3

Can you create the correct drawings to represent a Boolean logic circuit?

New cards
4

Can you create a table showing the truth values for a Boolean logic circuit?

Variables such as A or B are put through the Boolean logic circuit. They can represent true (1) or false (0) values. Depending on what the circuit looks like, the values can come out true or false. The final variable will be something like “Z”

New cards
5

Can you state the four original Karel functions?

put_ball(), take_ball(), turn_left(), move()

New cards
6

Can you distinguish between a high level of abstraction and a low level of abstraction?

High abstraction gives a bit of info and is simplified, low abstraction gives a lot of normally unnecessary information and is very detailed

New cards
7

Can you state the reasons why abstraction and decomposition are important in coding?

They work together so that code is easier to understand. Decomposition breaks a problem down into smaller parts so that it is easier to understand, and abstraction can simplify a problem

New cards
8

Can you distinguish between syntax and logical errors?

Syntax error: Is mechanically incorrect, the code is wrong

Logical error: The code is logically incorrect, the code doesn’t do what it should do

New cards
9

Decomposition

breaking a problem down into smaller parts

New cards
10

Top down design

A large problem is broken down into smaller parts step by step in order

New cards
11

Debugging

Fixing a flawed code by fixing syntax errors and logical errors

New cards
12

Can you state the purpose of using functions in programming?

To make code easier to understand

New cards
13

Can you write both a single-line and multi-line comment using correct notation?

Single line comment: #_____________

Multi line comment: ‘’’ then lines of code ‘’’ or “”” then lines of code “””

New cards
14

Can you write conditional statements and apply them to contextual situations?

Conditional statements apply to if something is true or not.

x=3

if x==3:

    print("Berry")

elif x>=0:

    print("Death")

else:

    print("Ilysm")

New cards
15

Can you write while loops and apply them to contextual situations?

Infinite loop unless it breaks or uses the function “break”

x=3

while x<=9:

   x=x+1

   print(x)

Output: 4,5,6,7,8,9,10

New cards
16

Can you state the four data types and what each data type represents?

str: a string, or text

int: an integer(whole) number

float: a decimal number

bool: True or False

New cards
17

Can you state the rules for naming variables in Python?

-May only include letters, numbers, and underscores; no other symbols

-cannot begin with numbers

-cannot include reserved words(while, in, else, etc.)

-names are case-sensitive.

New cards
18

Can you apply the seven arithmetic operations (+,-,*,/,**,//,%) to simple mathematical expressions?

+Is adding

-Is subtracting

* is multiplying

/ is division

** is exponents

// is floor division(rounds down, no matter what)

% gives the output of the remainder

New cards
19

Can you write code to prompt a user for information?

Prompting for integer: x = int(input(“____________”)

Prompting for a response: favorite_food = input(“What is your favorite food?”)

New cards
20

for i in range

for i in range(2,20,2):

    print(i)

the output for this example would be: 2, 4, 6, 8, 10, 12, 14, 16, 18

For i in range prints a sequence of numbers: start, stop, sequence 🙂

New cards
21

Can you concatenate strings to print out a statement that may include a literal string and one or more variables?

Yes! Even if they are integers, you can do this. It might look something like this:

x = input("How are you today? ")

y = int(input("What is your favorite number? "))

print("Amanda is " + x + " and her favorite number is " + str(y))

New cards

Explore top notes

note Note
studied byStudied by 6 people
663 days ago
5.0(1)
note Note
studied byStudied by 3 people
28 days ago
5.0(1)
note Note
studied byStudied by 13 people
856 days ago
5.0(1)
note Note
studied byStudied by 520 people
170 days ago
4.5(2)
note Note
studied byStudied by 3 people
38 days ago
5.0(1)
note Note
studied byStudied by 14 people
707 days ago
5.0(2)
note Note
studied byStudied by 37 people
869 days ago
5.0(1)
note Note
studied byStudied by 23695 people
704 days ago
4.8(93)

Explore top flashcards

flashcards Flashcard (98)
studied byStudied by 1 person
829 days ago
5.0(1)
flashcards Flashcard (27)
studied byStudied by 7 people
38 days ago
5.0(1)
flashcards Flashcard (23)
studied byStudied by 27 people
429 days ago
5.0(1)
flashcards Flashcard (44)
studied byStudied by 7 people
789 days ago
5.0(1)
flashcards Flashcard (35)
studied byStudied by 10 people
731 days ago
5.0(2)
flashcards Flashcard (107)
studied byStudied by 4 people
155 days ago
5.0(1)
flashcards Flashcard (21)
studied byStudied by 48 people
544 days ago
5.0(1)
flashcards Flashcard (32)
studied byStudied by 79 people
755 days ago
5.0(3)
robot