Purdue CNIT 155 Midterm Exam (Python)

0.0(0)
Studied by 10 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/181

flashcard set

Earn XP

Description and Tags

Last updated 2:25 PM on 10/26/22
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

182 Terms

1
New cards
User Layer
End users, developers...
2
New cards
Applications Layer
Microsoft Office, Safari, Bkackboard
3
New cards
Operating Systems Layer
Windows 10, Mac OS, iOS, Android, Linux...
4
New cards
Computer Hardware Layer
Disks, RAM, Leyboard, Mouse...
5
New cards
Computer Programming
The process of translating an algorithm into instructions that a computer can understand
6
New cards
Programming Language
A formal constructed language designed to communicate instructions to a computer
7
New cards
True or False: There are thousands of programming languages in existence.
True
8
New cards
Guido van Rossum
Creator of Python
9
New cards
Which of the following is an example of an input device?
Mouse
10
New cards
High level programming languages include:
Python, Java, C, etc.
11
New cards
Examples of operating systems do NOT include:
Excel
12
New cards
T or F: System Software provides the real functionality of a computer, helping your computer do specific types of work.
false
13
New cards
Which of the following is an example of software?
WingIDE 101
14
New cards
T or F: A bit is the smallest unit of data in a computer.
True
15
New cards
T or F: Python is commonly used to create things like websites, games, and graphic interfaces.
True
16
New cards
Of the options below, which equal one gigabyte?
1024 Megabytes (MB)
17
New cards
What is Syntax?
Rules that say what programs look like, and how the statements in the programming language are formed
18
New cards
Which of the following is NOT a device to store data in a computer?
RAM
19
New cards
T or F: Python is considered a low-level language.
False
20
New cards
What piece of hardware connects all the components and devices of a computer?
Motherboard
21
New cards
A computer's "working memory" is its:
RAM
22
New cards
System Software is used for
Managing a computer's resources
23
New cards
How many bytes are in a kilobyte?
1024
24
New cards
T or F: A computer, is some cases, understands more than machine code.
False
25
New cards
Refers to the tangible part of a computer system
Hardware
26
New cards
Examples of application software includes all of the following, except:
Android
27
New cards
T or F: print() is an example of an input.
False
28
New cards
T or F: Python needs a main function to operate.
False
29
New cards
Which of the following is an example of an integer?
4
30
New cards
T or F: String values can never be converted to integer values.
false
31
New cards
Which of the following is true about an integer?
An integer can be stored as a variable
32
New cards
T or F: Boolean only has two possible values.
True
33
New cards
Which of the following is an example of a boolean value?
True
34
New cards
T or F: "Hello, World!" is a string
True
35
New cards
Which of the following displays a proper string literal?
ProgrammingDialogue = 'Coding in python is fun!'
36
New cards
Which of the following is an example of a comment in python?
# This is a comment in python
37
New cards
What is the name of the python function that tells you a class?
Type
38
New cards
T or F: A string is a numerical type of data.
False
39
New cards
What is the extension of the source file for a python program?
.py
40
New cards
Which of the following is a legal variable name?
studentname1
41
New cards
Rules of naming identifiers include the following, except:
Can include a space
42
New cards
T or F: Values cannot be converted from one type to another.
False
43
New cards
What is Semantics?
Rules that say what the program means
44
New cards
What is Machine Code?
Numbers treated as instructions by the CPU. EX: 05 01 23
45
New cards
What is Assembly Code?
Humanly readable way of writing machine code.
EX:
add EAX, 1
mov [ESP+4], EAX
46
New cards
When is Assembly code used?
In small devices where the size of code is important, in hardware specific code like device drivers, where performance is critical
47
New cards
T or F: High-level language can be translated into many different machine code languages for different processors.
True
48
New cards
What is a Source Program?
A program written in a high-level language
49
New cards
What is Interpreter?
Translates the statements and executes the statements in order
50
New cards
What is Compiler?
Translates statements in a language into machine code
51
New cards
What is IDE?
Integrated development environment that combines several programming tools together into one cohesive program
52
New cards
What is the structure of a Python Program?
def main ():
Indentation
and
blocks
main ();
53
New cards
T or F: Comments should say why you are doing something.
True
54
New cards
What is a String Literal?
A stream of characters enclosed in double quotes
55
New cards
What does \n do?
Inserts a new line in the output
56
New cards
What does \t do?
Inserts a tab
57
New cards
What does \\ do?
Displays \
58
New cards
What does \" do?
Displays "
59
New cards
What are the three phases of solving any problem?
Inputs, then Processing, then Outputs
60
New cards
What is the data in a program?
Data value, data types, data name, data conversion
61
New cards
What is Data Value?
A value is one of the fundamental things, like a word or a number, that a program manipulates
62
New cards
What is Data Type?
Data values can be classified into different classes
63
New cards
These are examples of numerical data types
Integers, Floating point numbers, complex numbers
64
New cards
These are examples of textual data types
String
65
New cards
These are examples of boolean data types
Bool (True/False)
66
New cards
What is a Variable?
A place holder in computer's RAM
67
New cards
T or F: Any inputted data is going to be considered as a String data (Regardless of what the user inputted).
True
68
New cards
What is a Statement?
An instruction that the Python interpreter can execute
69
New cards
What is a Expression?
A combination of values, variables, operators, and calls to functions
70
New cards
What is Operators?
Special tokens that represent computations like addition, multiplication, and division
71
New cards
What is Operands?
The values the operator works on
72
New cards
Addition operator
+ (2 + 5 = 7)
73
New cards
Subtraction operator
- (2 - 5 = -3)
74
New cards
Multiplication operator
* (2 * 5 = 10)
75
New cards
Division operator
/ (2 / 5 = 0.4)
76
New cards
Modulus operator
% (2 % 5 = 2)
77
New cards
Exponent operator
** (2 ** 4 = 16)
78
New cards
Floor Division operator
// (9 // 2 = 4)
79
New cards
T or F: Arithmetic operators are binary operators.
True
80
New cards
In the expression (17 * 9), the operator is:
*
81
New cards
In the expression (17 * 9), the operant is:
17 and 9
82
New cards
T or F: The Precedence Rules state that anything inside the ( ) gets evaluated first.
True
83
New cards
What is Built-in functions?
They are part of Python language, and there is no need for the programmer to import any library to use them
84
New cards
What is Library functions?
These are inside a special library, such as the Math library, Random library, graphics library, etc
85
New cards
What is User-defined functions?
Functions created and defined by the user
86
New cards
You can use the math library by typing:
import math
87
New cards
What are Bugs?
Programming errors
88
New cards
What is Debugging?
The process of tracking down bugs and correcting them
89
New cards
What is Syntax Errors?
Result from errors in code construction, such as mistyping a keyword, omitting a necessary colon, or using a wrong indentation.

The program does not run. You have to fix this before rerunning the program.
90
New cards
What is Logical Errors?
Occur when a program provides you with actual outputs that are different from the desired outputs.

The program runs but it gives wrong results.
91
New cards
What is Run-Time Errors?
Occur while an application is running where Python interpreter detects an operation that is impossible to complete.

The program runs, but it does not complete. The program crashes in the middle of running.
92
New cards
Who is the inventor of Boolean Algebra?
George Boole
93
New cards
If a string can not be converted, you get a:
Run-time error
94
New cards
T or F: The print() function returns a value.
False
95
New cards
What does sep= do?
Separates arguments without using a space
96
New cards
What does end= do?
Prints string after all the arguments have been printed
97
New cards
What is a Test Plan?
A table with a number of test cases
98
New cards
Things you should identify and test in a test plan are:
Normal cases, special cases, boundary cases, and error cases
99
New cards
What is Regression?
Returning to an earlier, usually lower or less desirable state
100
New cards
What type of program flow does python use?
Top-down

Explore top notes

Explore top flashcards

flashcards
Chapter 1: The Human Organism
125
Updated 1201d ago
0.0(0)
flashcards
[PT11] Mechanical Principles
75
Updated 1148d ago
0.0(0)
flashcards
Abnormal Psychology: CH 9; E3
59
Updated 741d ago
0.0(0)
flashcards
BIO 202 Exam 1 vocab
124
Updated 198d ago
0.0(0)
flashcards
7A Realidades los números
32
Updated 152d ago
0.0(0)
flashcards
Los deportes
22
Updated 369d ago
0.0(0)
flashcards
Ap gov chapter 2 vocab
34
Updated 540d ago
0.0(0)
flashcards
Chapter 1: The Human Organism
125
Updated 1201d ago
0.0(0)
flashcards
[PT11] Mechanical Principles
75
Updated 1148d ago
0.0(0)
flashcards
Abnormal Psychology: CH 9; E3
59
Updated 741d ago
0.0(0)
flashcards
BIO 202 Exam 1 vocab
124
Updated 198d ago
0.0(0)
flashcards
7A Realidades los números
32
Updated 152d ago
0.0(0)
flashcards
Los deportes
22
Updated 369d ago
0.0(0)
flashcards
Ap gov chapter 2 vocab
34
Updated 540d ago
0.0(0)