PLTW: Computer Science Essentials - ACTUAL Quiz (5/5/23)

2.5(2)
studied byStudied by 12 people
GameKnowt Play
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/42

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

43 Terms

1
New cards
What file naming convention used in python? Give an example.
underscore_case
2
New cards
What is the file extension used for python files?
.py
3
New cards
Why is it important to use descriptive names for code files?
so that you know what each code file is and so that you can find it
4
New cards
Describe how a hashtag (#) is used to modify code.
It disables a line a code used for comments and headings.
5
New cards
Describe how a triple quotation mark (“““) is used to modify code.
Triple quotes are used to disable a section of code which can be used for debugging.
6
New cards
What type of function is a print statement?
built-in function
7
New cards
Besides the print statement, name one other built-in function in python.
input
8
New cards
What is the first thing that you would type to define a function in python?
def
9
New cards
How many times can a function be called upon in a program?
infinite
10
New cards
Write a print statement that says “I love nacho day”
print(“I love nacho day”)
11
New cards
What is the smallest unit of storage that a program can use?
variable
12
New cards
What is the difference between an assignment operator and an equality operator.
assignment operator uses one equal sign, equality operator uses two equal signs.
13
New cards
List 4 common data types.
float, integer, string, Boolean
14
New cards
What are 2 general types of variables?
local and global variables
15
New cards
True or false: Variables are case-sensitive
true
16
New cards
Give an example of when you would need to convert data types.
You may need to convert a data type if the user input is going to be a number, not a word. You would change the data type from a string to an integer.
17
New cards
What is an “argument” in computer science?
the values used in a program or a subroutine.
18
New cards
True or false: The Boolean values of true and false must be capitalized or the code editor will not recognize them as such.
true
19
New cards
What integers do the Boolean values correlate with?
0 and 1
20
New cards
Write a print statement that has a user input.
print(input(“How old are you?"”))
21
New cards
Abstraction is technique or process that manages _____ in a program or computer system by hiding specific details - allowing the programmer to focus on ____ and functions rater the the final output
**complexity, concepts**
22
New cards
Which statement best describes abstraction?
the result of designing a program where the focus is on what each step does instead of how the steps are implemented
23
New cards
Which situation is the best example of abstraction?
a teacher explains the mechanics of an engine by telling the students that turning the key will start a car
24
New cards
Within complex code, a programmer is likely to use a ____ level of abstraction to focus on the _____ details of a problem.
high, general
25
New cards
On a spreadsheet, the SUM command can be used to find the sum of the numbers in specific cells. For example, if you needed the sum of the cells A1 through M1, you would enter the formula =SUM(A1:M1). After entering the formula into a cell and pressing enter, the formula disappears and is replaced by the sum.

Why is the formula disappearing an example of abstraction?
The SUM formula does not need to be seen or understood in order to calculate the sum of the cells.
26
New cards
Image file
a digital representation of visual information
27
New cards
Audio file
a digital depiction of a sound waveform
28
New cards
Video file
a large, compressed file containing file containing visual and audio content
29
New cards
Programming file
a set of instruction that performs a task
30
New cards
Arrange the chunks of code in an order that will make the program compile and work without error.

1. D
2. A
3. B
4. C
31
New cards
Match each line of code to the proper coding concept.

Concatenation

Loop

Output

Procedure

1. B
2. C
3. D
4. A
32
New cards
What indicated string concatenation?
\+
33
New cards
What is the advantage of using the code chunk A?
This definition simplifies the program logic and maintenance
34
New cards
Software Development Process

1. Investigate
2. Plan
3. Design
4. Create & Test
5. Evaluate the Solution
6. Document & Present
35
New cards
Python Operators by Order of Operators
1st: Exponential \*\*

2nd: Multiplication/division/modulo \*,/,%

3rd: Addition/Subtraction +,-

4th: Relational ==, !=, >, >+=,
36
New cards
Which of the following would most benefit from an inline comment?
Line 7
37
New cards
What allows a programmer to create new abstractions through encapsulation?
Create functions
38
New cards
Output
print (item)
39
New cards
If statement
If not item:
40
New cards
Boolean code
while True:
41
New cards
Assignment Statement
GroceryItems=\[\]
42
New cards
Adding to a List
GroceryItems.append (item)
43
New cards
Which approach explains how the consultant’s trend data can best provide the city’s police force with flexibility and on-demand readiness in combating the recent rise in crime?
Provide police access to crime-trend data through mobile apps