Ultimate Computer Science 30 Final Flashcards

To get that 100%

You may prefer our related Brainscape-certified flashcards:
1
Q

Used to enter data into the computer

A

Input Device

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Accepts data from the CPU and produces an output

A

Output Device

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Physical cable that carries bits of data
A flat ribbon cable or a cable into the motherboard

A

Bus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

The main working memory of the computer
Software must be loaded into this to run

A

Random Access Memory (RAM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Used for high-speed storage of frequently used data
Can be part of the CPU or motherboard

A

Cache Memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

communication with memory.
communicates with input and output devices through the buses.
controls the timing and flow of information.
carries out the computations that a program might require.

A

Central Processing Unit (CPU)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Usually includes the power supply

A

The Case

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Most CPUs need this

A

Cooling Fan

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The working memory of the computer

A

RAM

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

RAM speed is measured in

A

Megahertz (MHz)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Used for high-end graphics and video games

A

Video cards

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

A large printed circuit board.
Provides the connections and sockets that let other components communicate with each other.

A

Motherboard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Computer brain.
Microprocessor.
A chip containing millions of tiny transistors.
job is to perform the calculations necessary to make the computer work.
decision-maker.

A

CPU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Can read data stored in it, but cannot write new data

A

Read-only Memory (ROM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Can read from and write to that memory

A

Random access memory (RAM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

the spine of the computer.
handles interactions between the software running on a computer and the machine hardware components.

A

Basic input/output system (BIOS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

supplies electricity throughout the rest of the computer.
shielded box containing a transformer

A

Power supply

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Converts the incoming electricity into the proper voltage for each part of the machine needs electricity

A

Transformer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

allows you to store info and apps directly on the computer

A

Hard drive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

machines that let computers communicate with other computing systems
closely related to wireless cards

A

Modem

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

radio transceivers that can send and receive data through a specific frequency of radio waves

A

Wireless card

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

removable components designed to fit into expansion slot

A

Video card

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Slots where you can add components to a PC that don’t have a designated slot somewhere on the motherboard

A

Expansion Slots

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Responsible for processor, memory, device, and storage management, and application and user interface

A

Operation System (OS)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

specialized processor with greater mathematical computing capabilities, making it perfect for computer graphics and machine learning activities

A

Graphics processing unit (GPU)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

any piece of hardware that isn’t mounted inside a PC’s case

A

Peripherals

27
Q

to properly remove heat from device components to improve device performance and extend its life.
incorporates a fan or other mechanism to reduce the temperature of a hardware component, such as a processor.

A

heat sink

28
Q

How to draw line?

A

drawLine(x-start, y-start, x-end, y-end)

29
Q

How to draw rectangle or square?

A

drawRect(x-top left corner, y-top left corner, width, height)

30
Q

How to draw oval or circle?

A

drawOval(x-top left corner, y-top left corner, width, height)

31
Q

How to draw an arc?

A

drawArc(x-top left corner, y-top left corner, width, height, starting angle of arc, total angle of arc)

32
Q

How to put in text?

A

g.drawString(string. x-start, v-position)

33
Q

Which of the following is NOT a valid type of comment in Python?

%% This is a comment

This is a comment

”””
This is a comment
“””

A

A

34
Q

Which of the following best describes the main purpose of comments?

Comments create better spacing in programs.

Comments describe your program so other people can read it more easily.

Comments warn the people running the program about potential problems with the program.

A

B.

35
Q

In the following line of code:

my_boolean = True and (10 / 0 == 0)

Will the 10 / 0 == 0 operation be evaluated?

Yes
No

A

A

36
Q

Which of the following evaluates to the variable x rounded to two decimal places?

round(x, 2)
round(2, x)
round(x), 2
round(2), x

A

A

37
Q

Fill in the blank with the best response:

Floating point numbers should be compared to determine if they are _______ equal to each other.

exactly
approximately

A

B

38
Q

How many lines will this program print?

x = 10
while x > 0:
print x
x = x - 3

3
4
5
6

A

B

39
Q

Which of the following best describes the purpose of a for loop?

A for loop is for doing something an indeterminate number of times.

A for loop is doing something an infinite number of times.

A for loop is for doing something a fixed number of times.

A for loop is for doing something three times.

A

C

40
Q

Which Python keyword skips back to the beginning of a loop?

break
continue

A

B.

41
Q

Which Python keyword exits a loop?

break
continue

A

A

42
Q

What does the following program print?

for i in range(2):
for j in range(2):
print i + j
——
0
1
1
2

0112

0
1
0
1

0101

A

A

43
Q

How many lines does the following program print?

for i in range(3):
for j in range(5):
print “hi”

3

5

8

15

A

D

44
Q

Which of the following code samples correctly passes the number 10 as an argument to the function print_number?

print_number(10)

print_number()
print 10

10(print_number)

print print_number
print 10

A

A

45
Q

Which of the following code samples correctly creates a function that takes a single parameter and prints it?

def print_number(x):
print x

def print_number():
print parameter

def print_number():
print x

def print(x)

A

A

46
Q

Which of the following functions successfully returns the number 10?

def my_function():
10

def my_function(10):
return

def my_function():
return 10

def my_function():
print 10

A

C

47
Q

Which of the following prints the letter A?

my_string = “ABCDE”
print(my_string[1])

my_string = “ABCDE”
print(my_string(0))

my_string = “ABCDE”
print(my_string(1))

my_string = “ABCDE”
print(my_string[0])

A

D

48
Q

Which of the following prints CDE?

my_string = “ABCDE”
print(my_string[3:])

my_string = “ABCDE”
print(my_string[2:])

my_string = “ABCDE”
print(my_string[3:5])

my_string = “ABCDE”
print(my_string[2:4])

A

B

49
Q

Which word applies to strings in Python?

mutable
immutable

A

B

50
Q

What does immutability mean?

Strings in Python can be modified and replaced.

Strings in Python can be modified, but not replaced.

Strings in Python can be replaced, but not modified.

Strings in Python can be neither replaced nor modified.

A

C

51
Q

Which operator allows you to create a string that is the result of putting two different strings together, side by side?

+

-

*

/

A

A

52
Q

Adding two strings together to form one string is also called:

slicing

concatenating

gluing

looping

A

B

53
Q

Which of the following programs DOES NOT PRINT the first five letters of the alphabet, each on its own line?

my_string = “abcde”
for letter in range(len(my_string)):
print(letter)

my_string = “abcde”
for letter in my_string:
print(letter)

my_string = “abcde”
for i in range(len(my_string)):
print(my_string[i])

A

A

54
Q

What does len(“hello”) evaluate to?

“hello”

“h”

“—–”

5

A

D

55
Q

What does the following program print?

print “a” in “banana”

True

False

1

“aaa”

A

A

56
Q

What does the following program print?

x = “ab”
y = “banana”
print x in y

True

False

0

“ba”

A

B

57
Q

Which of the following functions prints 3, and nothing else?

s = “hello”
x = s.find(“l”)
print x

s = “banana”
x = s.find(“a”)
print x

s = “hello”
for i in range(len(s)):
print i

s = “apple”
x = s.find(“l”)
print x

A

D

58
Q

What does the following program print?

first_string = “hello”
second_string = first_string.upper()

print first_string
print second_string
——
hello
hello

hello
HELLO

HELLO
hello

HELLO
HELLO

A

B

59
Q

Which of the following is NOT true about tuples?

Tuples are ordered.

Tuples are immutable.

Tuples can contain elements of different types.

Tuples use parentheses to access individual elements, rather than square brackets.

A

D

60
Q

Which of the following is the correct way to declare a tuple?

x = (1, 2, 3)

x = [1, 2, 3]

A

A

61
Q

Which of the following Python programs creates a list with the numbers 1 through 5?

my_list = (1, 2, 3, 4, 5)

my_list = [1, 2, 3, 4, 5]

my_list = 1, 2, 3, 4, 5

my_list = “1, 2, 3, 4, 5”

A

B

62
Q

Which of the following code snippets will correctly convert a string to a list?

my_string = “hello”
str_as_list = list(my_string)

my_string = “hello”
str_as_list = listify(my_string)

my_string = “hello”
str_as_list = make_list(my_string)

my_string = “hello”
str_as_list = new_list(my_string)

A

A

63
Q

my_list = [“bananas”, “oranges”, “grapes”, “pineapples”, “apples”]

You pick the code that goes here…
# …
# …

print my_list
Pick the code that results in the following output:

[‘apples’, ‘bananas’, ‘grapes’, ‘oranges’, ‘pineapples’]
______________________

my_list.sort()
my_list.reverse()

my_list.sort()

my_list.reverse()

my_list.remove(“grapes”)

A

B

64
Q

Look at the following program:

my_list = [“bananas”, “oranges”, “grapes”, “pineapples”, “apples”]

You pick the code that goes here…
# …
# …

print my_list
Pick the code that results in the following output:

[‘pineapples’, ‘oranges’, ‘grapes’, ‘apples’]

______________________

my_list.remove(“bananas”)

my_list.sort()
my_list.remove(“bananas”)

my_list.reverse()
my_list.remove(“bananas”)

my_list.sort()
my_list.reverse()
my_list.remove(“bananas”)

A

D