COSC 1436 Programming Fundamentals I - Midterm Practice Test

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

1/115

flashcard set

Earn XP

Description and Tags

Flashcards covering key concepts, definitions, and programming fundamentals from the COSC 1436 lecture notes.

Last updated 10:48 PM on 4/1/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

116 Terms

1
New cards

Software

Invisible instructions that control hardware and make it perform specific tasks.

2
New cards

Python file extension

.py

3
New cards

Bus

The subsystem that interconnects a computer's components.

4
New cards

What is the output of print(0 + 1 + 2)?

3

5
New cards

What is wrong with the statement: print(Howdy)?

Missing quotation marks around 'Howdy'.

6
New cards

Compiler

A program that translates source code into machine code.

7
New cards

Source Code

The human-readable instructions written by a programmer.

8
New cards

Interpreter

A program that executes instructions written in a programming language directly.

9
New cards

Machine Code

Native language consisting of binary instructions for a CPU.

10
New cards

Operating System

Software that manages computer hardware and software resources.

11
New cards

Bit

The smallest unit of data in a computer, represented as either 0 or 1.

12
New cards

Byte

A data unit consisting of 8 bits.

13
New cards

Kilobyte (KB)

Approximately 1000 bytes.

14
New cards

Gigabyte (GB)

Approximately 1 billion bytes.

15
New cards

ASCII

A character encoding standard for electronic communication.

16
New cards

True or False: Every Python statement must end with a semicolon.

False.

17
New cards

Screen resolution

Specifies the number of pixels in the horizontal and vertical dimensions of a display.

18
New cards

Machine language

The native code that consists of binary instructions.

19
New cards

True or False: Software is the physical aspect of a computer.

False.

20
New cards

Memory

A location where a program and its data must be moved before execution by the CPU.

21
New cards

Input Device

Keyboard.

22
New cards

Output Device

Printer.

23
New cards

Both Input and Output Device

Touchscreen.

24
New cards

True or False: Higher screen resolution produces a sharper image.

True.

25
New cards

True or False: Python can run on Mac, Unix, and Windows.

True.

26
New cards

True or False: Python is case sensitive.

True.

27
New cards

True or False: Python is a compiled language only.

False.

28
New cards

Guido van Rossum

Who developed Python around 1990?

29
New cards

Runtime error

An error that occurs during the execution of a program.

30
New cards

Syntax error

An error caused by incorrect code structure.

31
New cards

Logic error

An error where the code runs but produces incorrect results.

32
New cards

True or False: Indentation does not matter in Python.

False.

33
New cards

Gigahertz

The unit commonly used to measure CPU speed.

34
New cards

True or False: Memory is volatile while storage devices are permanent.

True.

35
New cards

Script mode

Allows running programs from a file.

36
New cards

Interactive mode

Allows running Python commands in a prompt.

37
New cards

print('Programming is fun')

The correct statement to print the phrase Programming is fun.

38
New cards

System analysis

The purpose is to identify system inputs and outputs.

39
New cards

System design

The purpose is to develop a process for transforming inputs to outputs.

40
New cards

IPO

Input Process Output.

41
New cards

Pseudocode

Describes algorithms using natural language.

42
New cards

Algorithms

Describe steps to solve a problem.

43
New cards

True or False: The Software Development Life Cycle includes stages such as requirements, design, testing, and maintenance.

True.

44
New cards

True or False: 'import' is an illegal identifier.

True.

45
New cards

camelCase identifiers

Examples include amtDollar, dollarAmt, dollarAmount, amountDollar.

46
New cards

Illegal variable names

sixth#place, 1stplace.

47
New cards

9 // 2, 9 / 2, 9 % 2, 9 ** 2

Results are 4, 4.5, 1, 81 respectively.

48
New cards

Output of print(2 + 3 * 2 + 7 // 2 - 10)

1.

49
New cards

Operands and operator in expression 12 + 7

Operands are 12 and 7; operator is +.

50
New cards

answer = 1 + 2

In Python, assigns the sum of 1 and 2 to the variable answer.

51
New cards

Value stored in price after executing price = int(68.549)

68.

52
New cards

Statement to read float input and store in x

x = float(input()).

53
New cards

Data types for: 123.456, int(123.456), '123.456', '123', 123, 123.0

float, int, string, string, int, float.

54
New cards

Output of: val = 99 and val += 1; print('The value is', 'val') and print('The value is', val)

'The value is val' and 'The value is 100'.

55
New cards

Output of print(round(value1 * value2)) for value1 = 2.0 and value2 = 12.2

24.

56
New cards

17 = x causes an error because

Cannot assign a literal value.

57
New cards

True or False: value = $3,450 is a valid Python statement.

False.

58
New cards

Output of: a,b = 5,6 ; a,b = b,a ; print(a,b)

6 5.

59
New cards

Why does multiplying two input() values cause an error without conversion?

input() returns strings.

60
New cards

Output of the Boolean expression not(x < y or z > x) and y < z with x=5, y=3, z=8

False.

61
New cards

Evaluate: x < y or z > x with values x=5, y=3, z=8

True.

62
New cards

Truth table results for the OR operator

Combinations where any true gives true.

63
New cards

Truth table results for the AND operator

Only true when both subexpressions are true.

64
New cards

True or False: an ifelifelse chain is the same as a nested if.

False.

65
New cards

if choice is not equal to 10

The if statement to check this condition.

66
New cards

ifelse statement

Executes one block if a condition is true and another if false.

67
New cards

,

Relational operators and their meanings.

68
New cards

Logical operator that requires both subexpressions to be true

and.

69
New cards

NOT a logical operator

if.

70
New cards

Condition checking if y is between 10 and 50 inclusive

if y >= 10 and y <= 50.

71
New cards

Operators that perform shortcircuit evaluation

and/or.

72
New cards

Value of z after the code: if x>=y: z=x+y else: z=y%x with x=10 and y=40

0.

73
New cards

Evaluate: a==4 or b>2 with a=2, b=4, c=6

True.

74
New cards

Output of if x != 10 statement that prints messages

'This is false!' then 'This is all folks!'.

75
New cards

Statement that assigns a random integer from 1 to 50 to number

number = random.randint(1,50).

76
New cards

True or False: if speed >=55 or speed <=65 checks if speed is between 55 and 65 correctly.

False.

77
New cards

Message printed if score = -1 in the validation example

Score is not valid.

78
New cards

Grade assigned if score=85 using multiple independent if statements for grade assignment

D.

79
New cards

Symbol marking the beginning and end of a string

Quotation marks.

80
New cards

Output of: print(2 * 'Hcc') and print('Welcome to ' + 'Hcc')

HccHcc and Welcome to Hcc.

81
New cards

Output of print('x' + 'y')

xy.

82
New cards

Evaluate: 'HCC' in s1 where s1='Welcome to Hcc' and 'come' not in s1

False, False.

83
New cards

Evaluate slices s1[-4:] and s1[3:] for s1='Welcome'

'come' and 'come'.

84
New cards

Output of swapping s1='smith' and s2='Mary' then printing s1 and s2.capitalize()

Mary Smith.

85
New cards

Output of: print('One', end='') print('Two') print('Three')

OneTwo then Three.

86
New cards

What does round(result) and format(result,'.2f') print for interestRate=0.77 and billAmount=10

8 and 7.700.

87
New cards

Difference between printing 3.246 and format(3.246,'.2f')

format rounds the display.

88
New cards

True or False: \n prints a literal capital N.

False.

89
New cards

Statement that prints 20%

print(format(0.2,'.0%')).

90
New cards

Two valid ways to print: The cat said "meow"

Using escape characters or different quotes.

91
New cards

Argument that prevents print from automatically moving to the next line

end argument.

92
New cards

Algebraic expression equivalent to math.pow(4,3)

4^3.

93
New cards

Function that returns the largest integer less than or equal to its argument

floor.

94
New cards

Expressions equivalent to math.hypot(x,y)

sqrt(x^2 + y^2).

95
New cards

True or False: math.ceil(x) returns the smallest integer greater than or equal to x.

True.

96
New cards

Two ways to fix print('COSC' + 1436)

Convert number to string or write 'COSC1436'.

97
New cards

True or False: chr(random.randint(0,127)) always generates a lowercase letter.

False.

98
New cards

True or False: repeat.upper() == 'Y' checks for either 'y' or 'Y'.

True.

99
New cards

For loop that prints the sum of numbers from 1 to 5

for number in range(1,6): total += number.

100
New cards

What is displayed after the loop: for num in range(0,20,5): num+=num; print(num)

30.

Explore top flashcards

flashcards
Semester 1 midterms science
21
Updated 108d ago
0.0(0)
flashcards
Prep Game Notes
31
Updated 435d ago
0.0(0)
flashcards
Gr 11 Bio - Evolution
54
Updated 1081d ago
0.0(0)
flashcards
SIS 342 FINAL EXAM
72
Updated 344d ago
0.0(0)
flashcards
Bio - Exam intra 1
108
Updated 550d ago
0.0(0)
flashcards
Welding Test. Airframe
35
Updated 479d ago
0.0(0)
flashcards
Semester 1 midterms science
21
Updated 108d ago
0.0(0)
flashcards
Prep Game Notes
31
Updated 435d ago
0.0(0)
flashcards
Gr 11 Bio - Evolution
54
Updated 1081d ago
0.0(0)
flashcards
SIS 342 FINAL EXAM
72
Updated 344d ago
0.0(0)
flashcards
Bio - Exam intra 1
108
Updated 550d ago
0.0(0)
flashcards
Welding Test. Airframe
35
Updated 479d ago
0.0(0)