Twa kɔ nsɛm atitiriw so
Log in
Sign up for FREE
arrow_back
Laabri

CSP Final Review - FLHS

star
star
star
star
star
Last updated over 3 years ago
90 Nsɛmmisa
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
2
7
4
4
6
1
5
9
2
4
1
1
15
1
1
1
1
1
3
1
1
1
1
1
1
1
1
1
1
1
3
5
8
1
1
1
1
1
1
1
1
1
4
1
1
1
1
1
1
1
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

What would be the output of the following code?

Asemmisa {{asɛmmisaAhyɛnsode}}
2.

Which of the following statements is true about control structures?

Asemmisa {{asɛmmisaAhyɛnsode}}
3.

Which of the following does the clear command do?

A. Clears the screen of any markings left by Tracy

B. Turns Tracy to face right

C. Sends Tracy to position (0,0)

Asemmisa {{asɛmmisaAhyɛnsode}}
4.

What will the output of the following code be?

Asemmisa {{asɛmmisaAhyɛnsode}}
5.

Asemmisa {{asɛmmisaAhyɛnsode}}
6.

How is an infinite loop created?

Asemmisa {{asɛmmisaAhyɛnsode}}
7.

Why do we use while loops?

Asemmisa {{asɛmmisaAhyɛnsode}}
8.

What would be the radius of the circle output from the following code?

Asemmisa {{asɛmmisaAhyɛnsode}}
9.

Which of the following if/else statements using a variable called ‘count’ are written correctly?

Asemmisa {{asɛmmisaAhyɛnsode}}
10.

What is the limit of conditions that can be used in an if/else statement?

Asemmisa {{asɛmmisaAhyɛnsode}}
11.

Which of the following is an example of an if/else statement scenario?

Asemmisa {{asɛmmisaAhyɛnsode}}
12.

If the following code was run, how far would Tracy move?

Asemmisa {{asɛmmisaAhyɛnsode}}
13.

Which comparison operator means ‘is not equal to’?

Asemmisa {{asɛmmisaAhyɛnsode}}
14.

How would we write an if statement where Tracy will put the pen down if a variable called count was positive?

Asemmisa {{asɛmmisaAhyɛnsode}}
15.

If we write an if statement and the condition is false, what does Tracy do?

Asemmisa {{asɛmmisaAhyɛnsode}}
16.

Why do we use if statements?

Asemmisa {{asɛmmisaAhyɛnsode}}
17.

What is the default starting value of i in a for loop?

Asemmisa {{asɛmmisaAhyɛnsode}}
18.

Variables allow us to:

Asemmisa {{asɛmmisaAhyɛnsode}}
19.

Which of the following is NOT an example of using Top Down Design?

Asemmisa {{asɛmmisaAhyɛnsode}}
20.

Top Down Design makes it easier to solve a problem by:

Asemmisa {{asɛmmisaAhyɛnsode}}
21.

What punctuation is needed to begin a multi-line comment?

Asemmisa {{asɛmmisaAhyɛnsode}}
22.

What symbol is used at the beginning of an in-line comment?

Asemmisa {{asɛmmisaAhyɛnsode}}
23.

Comments are:

Asemmisa {{asɛmmisaAhyɛnsode}}
24.

What are the dimensions of Tracy’s world?

Asemmisa {{asɛmmisaAhyɛnsode}}
25.

When Tracy is facing right, from what location does she start drawing her circle?

Asemmisa {{asɛmmisaAhyɛnsode}}
26.

When using the circle() command, what value do we put inside the parentheses?

Asemmisa {{asɛmmisaAhyɛnsode}}
27.

Which of the following statements is true? I. Computers have only been around since the 1940’s II. One reason computers were first developed was to do mathematical computations faster III. Some modern computers include laptops, cell phones, and tablets IV. Computers are able to perform tasks by using logic

Asemmisa {{asɛmmisaAhyɛnsode}}
28.

Which of the following statements is the simplest and most accurate definition of a computer?

Asemmisa {{asɛmmisaAhyɛnsode}}
29.

Which of the following choices correctly orders the early types of computers from earliest to most recent?

Asemmisa {{asɛmmisaAhyɛnsode}}
30.

What is the purpose of an output device?

Asemmisa {{asɛmmisaAhyɛnsode}}
31.

What is the purpose of an input device?

Asemmisa {{asɛmmisaAhyɛnsode}}
32.

What is the purpose of a network device?

Asemmisa {{asɛmmisaAhyɛnsode}}
33.

What is the purpose of a storage device?

Asemmisa {{asɛmmisaAhyɛnsode}}
34.

Which of the following statements is something the operating system of a computer is responsible for doing?

Asemmisa {{asɛmmisaAhyɛnsode}}
35.

Which of the following items is an example of a user application?

I. Browser II. Text editor III. Games IV. File Explorer

Asemmisa {{asɛmmisaAhyɛnsode}}
36.

Which of the following choices lists the three main components of a computer’s hardware?

Asemmisa {{asɛmmisaAhyɛnsode}}
37.

What does CPU stand for?

Asemmisa {{asɛmmisaAhyɛnsode}}
38.

Which of the following devices is the device that connects all of the physical components of a computer together?

Asemmisa {{asɛmmisaAhyɛnsode}}
39.

Which of the following fields use computers?

I. Computer Science II. Medicine III. Video Gaming IV. Automotive (Cars)

Asemmisa {{asɛmmisaAhyɛnsode}}
40.

Which of the following is an application of Artificial Intelligence?

Asemmisa {{asɛmmisaAhyɛnsode}}
41.

Match the term to the definition

Draggable itemarrow_right_altCorresponding Item

Unary Operators

arrow_right_alt

Operators that occur between two things

Binary Operators

arrow_right_alt

Operators that only apply to one thing

Asemmisa {{asɛmmisaAhyɛnsode}}
42.

Know what operations the following symbols represent.

+ ⇛

- ⇛

* ⇛

/ ⇛

** ⇛

% ⇛

- ⇛ (unary operator)

// ⇛

Asemmisa {{asɛmmisaAhyɛnsode}}
43.

In the following equation, in what order do you complete the operations in Python? (drag to reorder)

6 - 3 ** 2 / (1 + 1)

  1. 1 + 1

  2. 3 ** 2

  3. 2/

  4. 6 - 3

Asemmisa {{asɛmmisaAhyɛnsode}}
44.

In the following equation, in what order do you complete the operations in Python? (drag to reorder)

(6 + (3 - 2 * 2)) ** 2

  1. 2 * 2

  2. 3 - 2

  3. 6 + (_____)

  4. (______) ** 2

Asemmisa {{asɛmmisaAhyɛnsode}}
45.

Which of the following statements will cause an error assuming age has the value 15 and student the value Billy-Bob

Asemmisa {{asɛmmisaAhyɛnsode}}
46.

Which one of the statements below will cause an error?

Asemmisa {{asɛmmisaAhyɛnsode}}
47.

What type the variable on the left getting in each line

  • a = y + .9

  • x = "bar"

  • y = 4

  • z = x * y

  • b = x + y

  • str

  • int

  • float

  • This line will cause a crash

Asemmisa {{asɛmmisaAhyɛnsode}}
48.

I detify the value that would be stored in each type

  • "elephant"

  • -3.14

  • 7.0

  • "5.6"

  • 6

  • "name"

  • "user"

  • 0.9

  • -15

  • String

  • Integer

  • Float

Asemmisa {{asɛmmisaAhyɛnsode}}
49.

- is the character(s) used to start an in-line Python Comment

- is the character(s) used to start a multiline Python Comment

Asemmisa {{asɛmmisaAhyɛnsode}}
50.

Reorder the statements to put them in the order to get input from the user and print out the result

  1. user_color = input("What is your favorite color? ")

  2. print("Your favorite color is " + user_color)

  3. confirm = input("Is that correct? (Yes or No)")

  4. print("You have chosen " + confirm)

Asemmisa {{asɛmmisaAhyɛnsode}}
51.

What is the output of the following program? Assume the user enters "Will Smith", then "Wild Wild West"?

favorite_actor = input ("What is your favorite Actor? ")

best_movie = input ("What is your favorite move that actor is in? ")

fav_movie_actor = favorite_actor + best_movie

Asemmisa {{asɛmmisaAhyɛnsode}}
52.

What would be the proper way to name a variable in Python that stores the users ID number

Asemmisa {{asɛmmisaAhyɛnsode}}
53.

Answer the following questions about the program below

students = int(input("Number of students: ")

size_of_groups = int(input("How many in a group: ")

num_per_group = students // size_of_groups

students_remaining = students % size_of_groups

print("Each group will be " + str(num_per_group) + " students with one group of " + str(students_remaining))

What does the Python program do?

What is the purpose of // in this program?

What is the % operator doing in this program?

Asemmisa {{asɛmmisaAhyɛnsode}}
54.

Is there any limit of statement that can appear under an if block.

Asemmisa {{asɛmmisaAhyɛnsode}}
55.

What print statement will run if the user enters 19 when prompted?

age=int(input("Enter your age"))

if age >=18:

print("Eligible for voting")

else:

print("not eligible for voting")

Asemmisa {{asɛmmisaAhyɛnsode}}
56.

The if...elif...else executes only one block of code among several blocks

Asemmisa {{asɛmmisaAhyɛnsode}}
57.

How would you round the number held in the variable e to 2.718?

Asemmisa {{asɛmmisaAhyɛnsode}}
58.

How would you round the number 10.758321 held in the variable num1 to 10.76?

Asemmisa {{asɛmmisaAhyɛnsode}}
59.

A company decided to give bonus of 5% to employee if his/her year of service is more than 5 years. Ask user for their salary and year of service and print the net bonus amount. Fill in the blanks to complete the below code.

salary = "Enter salary: ") ) yos = "Enter year of service")) if >5: print "Bonus is",.05*salary else: print "No bonus"

Asemmisa {{asɛmmisaAhyɛnsode}}
60.

What will print to the screen when the following program is run?

number = 10

greater_than_pi = number > 3.14

print(type(number)

Asemmisa {{asɛmmisaAhyɛnsode}}
61.

What will print to the screen when the following program is run?

number = 10

greater_than_pi = number > 3.14

print(type(greater_than_pi)

Asemmisa {{asɛmmisaAhyɛnsode}}
62.

What will print to the screen when the following program is run?

value = -7.52

less_than_zero = value < 0

print(type(less_than_zero)

Asemmisa {{asɛmmisaAhyɛnsode}}
63.

What will print to the screen when the following program is run?

value = -7.52

less_than_zero = value < 0

print(less_than_zero)

Asemmisa {{asɛmmisaAhyɛnsode}}
64.

What will the results be of the following statement

5 == 5

Asemmisa {{asɛmmisaAhyɛnsode}}
65.

What will the results be of the following statement

3 == 5

Asemmisa {{asɛmmisaAhyɛnsode}}
66.

What will the results be of the following statement

5 == 5.0

Asemmisa {{asɛmmisaAhyɛnsode}}
67.

What will the results be of the following statement

"eric" == "eric"

Asemmisa {{asɛmmisaAhyɛnsode}}
68.

What will the results be of the following statement

"Eric" == "eric"

Asemmisa {{asɛmmisaAhyɛnsode}}
69.

What will the results be of the following statement

"5" == 5

Asemmisa {{asɛmmisaAhyɛnsode}}
70.

What will the results be of the following statement

num1 = 5

"5" == str(num1)

Asemmisa {{asɛmmisaAhyɛnsode}}
71.

Write a program that does the following:

Assign 10 to x. If x is bigger than 0, print "x is a positive number".

Asemmisa {{asɛmmisaAhyɛnsode}}
72.

Write a program that does the following:

Assign -50 to y. If y is bigger than 0, print "y is a positive number". Else, print "y is a negative number".

Asemmisa {{asɛmmisaAhyɛnsode}}
73.

Write a program that does the following:

Assign 0 to z. If z is bigger than 0, print "z is a positive number". Else if z is zero, print "z is 0". Else, print "z is a negative number".

Asemmisa {{asɛmmisaAhyɛnsode}}
74.

Given the nested if-else structure below, what will be the value of x after code execution completes

x = 0 a = 0 b = -5 if a > 0: if b < 0: x = x + 5 elif a > 5: x = x + 4 else: x = x + 3 else: x = x + 2 print(x)

Asemmisa {{asɛmmisaAhyɛnsode}}
75.

Given the nested if-else below, what will be the value x when the code executed successfully

x = 0 a = 5 b = 5 if a > 0: if b < 0: x = x + 5 elif a > 5: x = x + 4 else: x = x + 3 else: x = x + 2 print(x)

Asemmisa {{asɛmmisaAhyɛnsode}}
76.

What does the following code print to the console?

if 5 > 10: print("fan") elif 8 != 9: print("glass") else: print("cream")

Asemmisa {{asɛmmisaAhyɛnsode}}
77.

What does the following code print to the console?

name = "maria" if name == "melissa": print("usa") elif name == "mary": print("ireland") else: print("colombia")

Asemmisa {{asɛmmisaAhyɛnsode}}
78.

hair_color = "blue" if 3 > 2: if hair_color == "black": print("You rock!") else: print("Boring")

Asemmisa {{asɛmmisaAhyɛnsode}}
79.

What does the following code print to the console?

if True: print(101) else: print(202)

Asemmisa {{asɛmmisaAhyɛnsode}}
80.

What does the following code print to the console?

if False: print("Nissan") elif True: print("Ford") elif True: print("BMW") else: print("Audi")

Asemmisa {{asɛmmisaAhyɛnsode}}
81.

In a Python program, a control structure:

Asemmisa {{asɛmmisaAhyɛnsode}}
82.

What signifies the end of a statement block or suite in Python?

Asemmisa {{asɛmmisaAhyɛnsode}}
83.

Write an if statement that asks for the user's name via input() function. If the name is "Bond" make it print "Welcome on board 007." Otherwise make it print "Good morning NAME". (Replace Name with user's name)

Asemmisa {{asɛmmisaAhyɛnsode}}
84.

The break statement causes what?

Asemmisa {{asɛmmisaAhyɛnsode}}
85.

The continue statement causes what?

Asemmisa {{asɛmmisaAhyɛnsode}}
86.

What is the result of executing the following code?

number = 5 while number <= 5: if number < 5: number = number + 1 print(number)

Asemmisa {{asɛmmisaAhyɛnsode}}
87.

What will the following code print?

counter = 1 sum = 0 while counter <= 6: sum = sum + counter counter = counter + 2 print(sum)

Asemmisa {{asɛmmisaAhyɛnsode}}
88.

What is the last thing printed when the following code is run?

number = 0 while number <= 10: print("Number: ", number) number = number + 1

Asemmisa {{asɛmmisaAhyɛnsode}}
89.

What does the following code print?

output = "" x = -5 while x < 0: x = x + 1 output = output + str(x) + " " print(output)

Asemmisa {{asɛmmisaAhyɛnsode}}
90.

The following code contains an infinite loop. Which is the best explanation for why the loop does not terminate?

n = 10 answer = 1 while n > 0: answer = answer + n n = n + 1 print(answer)