Preskoči na glavni sadržaj
Prijava
Sign up for FREE
arrow_back
Biblioteka

CSP Final Review - FLHS

star
star
star
star
star
Posljednje ažuriranje over 3 years ago
90
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
Pitanje 1
1.

What would be the output of the following code?

Pitanje 2
2.

Which of the following statements is true about control structures?

Pitanje 3
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)

Pitanje 4
4.

What will the output of the following code be?

Pitanje 5
5.

Pitanje 6
6.

How is an infinite loop created?

Pitanje 7
7.

Why do we use while loops?

Pitanje 8
8.

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

Pitanje 9
9.

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

Pitanje 10
10.

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

Pitanje 11
11.

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

Pitanje 12
12.

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

Pitanje 13
13.

Which comparison operator means ‘is not equal to’?

Pitanje 14
14.

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

Pitanje 15
15.

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

Pitanje 16
16.

Why do we use if statements?

Pitanje 17
17.

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

Pitanje 18
18.

Variables allow us to:

Pitanje 19
19.

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

Pitanje 20
20.

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

Pitanje 21
21.

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

Pitanje 22
22.

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

Pitanje 23
23.

Comments are:

Pitanje 24
24.

What are the dimensions of Tracy’s world?

Pitanje 25
25.

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

Pitanje 26
26.

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

Pitanje 27
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

Pitanje 28
28.

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

Pitanje 29
29.

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

Pitanje 30
30.

What is the purpose of an output device?

Pitanje 31
31.

What is the purpose of an input device?

Pitanje 32
32.

What is the purpose of a network device?

Pitanje 33
33.

What is the purpose of a storage device?

Pitanje 34
34.

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

Pitanje 35
35.

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

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

Pitanje 36
36.

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

Pitanje 37
37.

What does CPU stand for?

Pitanje 38
38.

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

Pitanje 39
39.

Which of the following fields use computers?

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

Pitanje 40
40.

Which of the following is an application of Artificial Intelligence?

Pitanje 41
41.

Match the term to the definition

Stavka koja se može prevućiarrow_right_altOdgovarajuća stavka

Unary Operators

arrow_right_alt

Operators that occur between two things

Binary Operators

arrow_right_alt

Operators that only apply to one thing

Pitanje 42
42.
Pitanje 43
43.

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

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

  1. 2/

  2. 6 - 3

  3. 1 + 1

  4. 3 ** 2

Pitanje 44
44.

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

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

  1. 6 + (_____)

  2. 2 * 2

  3. 3 - 2

  4. (______) ** 2

Pitanje 45
45.

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

Pitanje 46
46.

Which one of the statements below will cause an error?

Pitanje 47
47.

What type the variable on the left getting in each line

  • a = y + .9

  • z = x * y

  • x = "bar"

  • b = x + y

  • y = 4

  • str

  • int

  • float

  • This line will cause a crash

Pitanje 48
48.

I detify the value that would be stored in each type

  • -3.14

  • 7.0

  • "name"

  • 6

  • "user"

  • "elephant"

  • 0.9

  • -15

  • "5.6"

  • String

  • Integer

  • Float

Pitanje 49
49.
Pitanje 50
50.

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

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

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

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

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

Pitanje 51
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

Pitanje 52
52.

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

Pitanje 53
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?

Pitanje 54
54.

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

Pitanje 55
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")

Pitanje 56
56.

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

Pitanje 57
57.

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

Pitanje 58
58.

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

Pitanje 59
59.
Pitanje 60
60.

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

number = 10

greater_than_pi = number > 3.14

print(type(number)

Pitanje 61
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)

Pitanje 62
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)

Pitanje 63
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)

Pitanje 64
64.

What will the results be of the following statement

5 == 5

Pitanje 65
65.

What will the results be of the following statement

3 == 5

Pitanje 66
66.

What will the results be of the following statement

5 == 5.0

Pitanje 67
67.

What will the results be of the following statement

"eric" == "eric"

Pitanje 68
68.

What will the results be of the following statement

"Eric" == "eric"

Pitanje 69
69.

What will the results be of the following statement

"5" == 5

Pitanje 70
70.

What will the results be of the following statement

num1 = 5

"5" == str(num1)

Pitanje 71
71.

Write a program that does the following:

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

Pitanje 72
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".

Pitanje 73
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".

Pitanje 74
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)

Pitanje 75
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)

Pitanje 76
76.

What does the following code print to the console?

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

Pitanje 77
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")

Pitanje 78
78.

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

Pitanje 79
79.

What does the following code print to the console?

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

Pitanje 80
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")

Pitanje 81
81.

In a Python program, a control structure:

Pitanje 82
82.

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

Pitanje 83
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)

Pitanje 84
84.

The break statement causes what?

Pitanje 85
85.

The continue statement causes what?

Pitanje 86
86.

What is the result of executing the following code?

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

Pitanje 87
87.

What will the following code print?

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

Pitanje 88
88.

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

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

Pitanje 89
89.

What does the following code print?

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

Pitanje 90
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)