Introduction to Programming
- 82Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
82 questions
- 1The only language that machines ultimately understand is_____.
Hint
This language is composed of only two digits: 0s and 1s.
Answer
binary
- 2In the context of computer science, problem-solving can be distilled into having inputs, wanting outputs, and needing to do something with those inputs in the_____.
Hint
This refers to the process or algorithm that transforms the initial data.
Answer
middle
- 3At its most basic level, a computer's only input is electricity, which can be thought of as existing in two states: 1 or 0, true or_____.
Hint
This describes the fundamental logical states of binary information.
Answer
false
- 4ASCII is a global standard used for mapping numbers to_____.
Hint
This standard allows computers to represent text characters using numerical values.
Answer
letters
- 5In a graphics program, numerical values like 72, 73, and 33 can be interpreted as amounts of red, green, and_____to represent colors.
Hint
This is a common color model used in digital imaging.
Answer
blue
- 6Videos and movies are essentially sequences of_____flying past your human eyes very quickly.
Hint
This describes how motion is created in digital media.
Answer
images
- 7The value of_____in computer science allows us to assume that underlying complex details are handled by someone else, so we don't need to think at that low level.
Hint
This concept involves hiding complex implementation details and showing only the essential information.
Answer
abstraction
- 8The 'secret sauce' inside a 'black box' where problems are actually solved are called_____.
Hint
These are step-by-step procedures for solving a problem.
Answer
algorithms
- 9An algorithm that involves turning the phone book page by page one at a time would be represented graphically as a_____line due to its one-to-one correspondence between pages and turns.
Hint
This indicates a linear relationship in terms of efficiency.
Answer
straight
- 10The dividing and conquer algorithm, like opening a phone book to the middle and repeating the process, focuses on improving_____.
Hint
This strategy aims to solve problems faster.
Answer
efficiency
- 11To express algorithms more precisely, we use_____, which is English-like, succinct, and gets the point across without formal definition.
Hint
This is an informal high-level description of an algorithm.
Answer
pseudocode
- 12Concepts like loops, conditions, Boolean expressions, and variables serve as_____for building programs.
Hint
These are fundamental components used in programming languages.
Answer
building blocks
- 13Statements like 'open to the middle of the phone book' or 'call Mike' are examples of_____that are useful but require more detailed instructions for a computer.
Hint
These statements hide complex underlying steps.
Answer
abstractions
- 14The peanut butter and jelly sandwich exercise demonstrated how many_____are often made in human communication that would cause a computer program to fail without explicit instructions.
Hint
This highlights the need for precision when programming.
Answer
assumptions
- 15If a programmer does not handle 'corner cases' or think about the precise meaning of an instruction, the program may_____.
Hint
This describes a common outcome of a lack of specificity or precision in code.
Answer
crash
- 16Creating your own 'puzzle pieces' or custom blocks in Scratch, like the 'cough' example, is useful because it allows you to reuse that_____without worrying about its implementation details.
Hint
This concept allows you to simplify complex operations once they are defined.
Answer
abstraction
- 17The text-based programming language introduced as an older, more traditional alternative to Scratch is_____.
Hint
This language is known for its power and control over hardware.
Answer
C
- 18The C code_____
printf("hello, world\n");when executed, simply prints the phrase 'hello world' to the.Hint
This is a common output operation in programming.
Answer
screen
- 19When transitioning from Scratch to C, it is important to understand that while syntax may be frustrating, the underlying_____are the most important takeaway.
Hint
Focus on the core concepts, not just the specific keywords and symbols.
Answer
principles
- 20In programming, a 'function' is generally considered a_____or an action that has functionality built into it.
Hint
Think about what a function does.
Answer
verb
- 21In C, the function to print formatted text is called `_____`, where the 'f' stands for formatted.
Hint
This is the primary output function in C.
Answer
printf
- 22In C, strings that are passed to_____
printfmust be surrounded by double.Hint
This is a syntactic requirement for literal strings in C.
Answer
quotes
- 23To move the cursor to the next line on the screen in C, you need to explicitly tell the computer by typing `_____`.
Hint
This is an escape sequence for a newline character.
Answer
\n
- 24Most lines of code in C must end with a_____as the equivalent of a period in an English sentence.
Hint
This punctuation mark indicates the end of a statement.
Answer
semi-colon
- 25In C, the backslash character is used as an_____character when you want to show information in a slightly different way, such as
\nfor a newline.Hint
This character changes the interpretation of the following character.
Answer
escape
- 26A 'variable' in programming, similar to x and y in algebra, is a_____for data.
Hint
It's a named storage location for values.
Answer
placeholder
- 27When declaring a variable in C, you must specify its_____, such as
intfor an integer.Hint
This tells the computer what kind of data the variable will store.
Answer
type
- 28In C, the_____
=symbol is used for, meaning it copies the value on the right into the variable on the left.Hint
This operator gives a value to a variable.
Answer
assignment
- 29The shorthand_____
counter += 1in C is an example ofsugar, allowing you to writecounter = counter + 1more succinctly.Hint
This refers to features that make code easier or shorter to write without changing functionality.
Answer
syntactic
- 30The even more succinct way to increment a variable by 1 in C is `counter_____`.
Hint
This is a common unary operator for increasing a variable's value by one.
Answer
++
- 31In Scratch, an 'if' block represents a_____, which can be translated directly to
ifin C.Hint
This construct allows a program to make decisions.
Answer
condition
- 32In C, a Boolean expression within an_____
ifstatement must be enclosed in.Hint
These symbols are required around the condition being tested.
Answer
parentheses
- 33Curly braces (_____
{}) in C are used to group multiple lines of code, similar to the embracing shape ofblocks in Scratch.Hint
These blocks in Scratch define a code block that executes together.
Answer
yellow
- 34In C, to check for equality, you must use a double equal sign (`_____`) to distinguish it from the assignment operator.
Hint
This is the comparison operator for determining if two values are the same.
Answer
==
- 35When comparing two integers, x and y, there are exactly_____possible cases: less than, greater than, or equal to.
Hint
Consider all logical possibilities.
Answer
three
- 36Optimizing_____
if-else if-else ifstatements by removing the finalelse iffor equality and replacing it with justelsesaves the computer.Hint
This reduces redundant checks.
Answer
time
- 37In C, the keyword `_____` is used to create a loop that repeats actions, similar to Scratch's 'forever' block.
Hint
This loop continues as long as a condition is true.
Answer
while
- 38To create an infinite loop in C using_____
while, the condition inside the parentheses should be ``.Hint
This keyword always evaluates to a positive logical state.
Answer
true
- 39In C, the convention for starting to count in programming is typically from_____.
Hint
This relates to the smallest representable binary value.
Answer
0
- 40A 'string' in a programming language is simply a sequence of_____.
Hint
It's how words, phrases, or paragraphs are represented.
Answer
characters
- 41The_____
printffunction in C can take multiple inputs; the first is the format string, and subsequent inputs areto be plugged into placeholders.Hint
These provide the actual data for the format specifiers.
Answer
variables
- 42In C, the placeholder_____
%sin a format string is used to indicate where ashould be substituted.Hint
This format code stands for a sequence of characters.
Answer
string
- 43The CS50 Sandbox is a cloud-based application that provides a standardized_____environment for writing and running code.
Hint
It's an online tool for practicing coding without local setup issues.
Answer
programming
- 44The_____
mainfunction in C is the equivalent of Scratch's 'clicked' block, indicating where the program execution begins.Hint
This is the entry point of a C program.
Answer
when green flag
- 45Source code, written in languages like C, needs to be converted into_____code (zeros and ones) for the machine to understand.
Hint
This is the low-level binary language processed by the CPU.
Answer
machine
- 46A_____is a program that allows us to convert source code into machine code.
Hint
This tool translates high-level code into low-level instructions.
Answer
compiler
- 47The blinking prompt with a dollar sign in the CS50 Sandbox indicates a_____window, where users type commands to the computer.
Hint
This is a text-based interface for interacting with the operating system.
Answer
terminal
- 48To compile a C program named_____
hello.c, the commandclang hello.cis used, whereclangis the.Hint
This is the specific program that translates C code.
Answer
compiler
- 49After compilation, the executable machine code is conventionally stored in a file called `_____`.
Hint
This is the default output file name for many C compilers.
Answer
a.out
- 50To run an executable file named_____
a.outin a Linux environment, you type ``.Hint
This command specifies to execute the file in the current directory.
Answer
./a.out
- 51To specify the output filename for a compiled program, the_____
-oflag is used with the compiler, as in `clang -o hello`.Hint
This is the source code file that needs to be compiled.
Answer
hello.c
- 52The_____
makecommand automates the compilation process by looking for a source file named `` by default, saving the programmer from typing complex commands.Hint
This command assumes a conventional naming for C source files.
Answer
hello.c
- 53When encountering cryptic error messages during compilation, it's most important to start debugging by looking at the_____of the error output.
Hint
Initial errors often cause a cascade of subsequent, misleading errors.
Answer
top
- 54In C,_____
stringis not a built-in, but rather a type provided by libraries like CS50.h.Hint
This refers to a category of data that a variable can hold.
Answer
type
- 55The_____
stdio.h(standard input/output header) file provides access to handy features like the `` function.Hint
This function is used for output to the console.
Answer
printf
- 56The input to a function is typically called an argument or a_____.
Hint
These are values passed to a function when it is called.
Answer
parameter
- 57Random Access Memory (RAM) is a type of_____storage, used by programs while they are running.
Hint
Data stored here is lost when power is off.
Answer
temporary
- 58In a computer, 'floats' or floating-point values are numbers that can have_____points.
Hint
These numbers are used to represent non-integer values.
Answer
decimal
- 59The placeholder_____
%iin aprintfformat string is used to substitute an.Hint
This format code is for whole numbers.
Answer
integer
- 60For multiplication in C, the `_____` (asterisk) symbol is used instead of 'x'.
Hint
This is a common symbol for multiplication in programming.
Answer
- 61The_____
%operator in C performsarithmetic, returning the remainder of a division.Hint
This operator is sometimes called the 'remainder operator'.
Answer
modular
- 62When dividing two integers in C, such as_____
2 / 10, the result will be0because it performsarithmetic, truncating any decimal part.Hint
The data type of the operands determines the type of the result.
Answer
integer
- 63Representing an infinite number of real numbers with a finite amount of computer memory inevitably leads to_____.
Hint
Computers cannot store every digit of every number.
Answer
imprecision
- 64A `_____
in C is a data type that uses 32 bits of space, while adouble` uses twice as many bits (64 bits) for greater precision.Hint
This is a single-precision floating-point type.
Answer
float
- 65When using_____
printfwith afloatordouble, you can specify the number of decimal places to display by using `%.f, whereN` is the number of decimal places.Hint
This is a format specifier for controlling floating-point output.
Answer
N
- 66Comparing floating-point values for strict `_____` in code is generally discouraged due to potential imprecision.
Hint
Due to rounding errors, two floating-point numbers that should be the same might differ slightly.
Answer
equality
- 67The term 'parity' in the context of numbers refers to whether a number is even or_____.
Hint
This classification is based on divisibility by two.
Answer
odd
- 68In C, the_____
||(double vertical bar) operator represents a logical, meaning 'either this OR that'.Hint
This operator combines conditions, where at least one must be true.
Answer
OR
- 69When creating custom functions in C, you must declare a_____for the function before it is used in
mainor elsewhere in the code.Hint
This provides a forward declaration of the function's signature.
Answer
prototype
- 70The_____
voidkeyword when used as a function's return type indicates that the function does notany value.Hint
This means the function performs an action but doesn't hand back data.
Answer
return
- 71The_____
voidkeyword used inside the parentheses of a function's declaration (e.g.,int main(void)) indicates that the function does not take any.Hint
This means the function doesn't accept any arguments.
Answer
inputs
- 72If a computer's hardware only has space for three digits,_____
999 + 1would result in0due to integer.Hint
This occurs when a number becomes too large for its assigned storage space.
Answer
overflow
- 73In C,_____
//is used to denote aon a single line.Hint
This is for human-readable notes in the code.
Answer
comment
- 74The_____
sleepfunction, which pauses program execution for a specified number of seconds, has its prototype declared in ``.Hint
This header file provides access to various POSIX operating system API functions.
Answer
unistd.h
- 75The `_____
operator in C doubles the value of a variable, similar toi = i * 2`.Hint
This is a compound assignment operator for multiplication.
Answer
*=
- 76The Y2K problem was primarily caused by programmers using only two digits to store the_____, leading to potential confusion with the year 1900.
Hint
This was a millennium bug related to date formatting.
Answer
year
- 77Integer_____occurs when a number becomes too small for its assigned storage space, leading to a wrap-around to the maximum representable value.
Hint
This is the opposite of overflow, often resulting in a large positive number from a small negative one.
Answer
underflow
- 78The_____
do-whileloop in C guarantees that the code block will execute at leastbefore checking the condition.Hint
Unlike a
whileloop, the condition is evaluated after the first iteration.Answer
once
- 79In C, the_____
returnkeyword is used to send aback from a function to the code that called it.Hint
This terminates the function execution and provides an output.
Answer
value
- 80Variables in C have_____, meaning they only exist and are accessible within the curly braces between which they were declared.
Hint
This defines the region of a program where a variable can be used.
Answer
scope
- 81A 'long' is a_____-bit integer, offering a larger range of values compared to a typical 32-bit integer.
Hint
This data type uses twice the storage of a standard integer.
Answer
64
- 82In the game Civilization, Gandhi's aggression level would loop around to_____
255(very aggressive) if it was reduced below 0, an example of integer.Hint
This bug occurred because of how a single byte of memory was handled.
Answer
underflow

Ask anything
We've read this whole study set, so questions about it get the best answers.