1/48
Vocabulary flashcards covering core concepts from Computer Programming CS 102 midterms reviewer, including programming basics, algorithms, C language components, streams, formatted I/O, and file processing.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Computer Programming
Writing instructions and giving them to the computer to complete a task (i.e. software).
Operating System
Manages computer hardware and software resources.

Compilers and Interpreters
Translate high-level code into machine language.
Applications
Executes a specific user-driven task.
Embedded Systems
Controls the physical hardware of a dedicated device.
Compiler
Translates the whole program once before executing.
Interpreter
Translates and executes the program one line at a time.
Source Code
Human-understandable program.
Object Code
Machine-understandable program.
Problem-Solving Phase
The initial phase of programming consisting of Defining Problem (determine program function and requirements) and Designing Program (make an algorithm).
Implementation Phase
The phase of programming consisting of Coding (express algorithm into programming language, translate source code into object code) and Testing and Debugging (find out if output is correct, search for bugs/errors).
High-Level Language
Uses English-like words, mathematical symbols, and familiar syntax.
Low-Level Language
Interacts directly with the CPU, registers, and memory addresses.
Algorithm
A sequence of instructions describing how to do a task.
Values and Variables
Values may be any quantities, measurements, or data. Variables contain values.
Instructions (Algorithm)
Action that is simple (primitives); manipulates/controls the variable or value.
Sequence
A series of instructions.
Procedure
Sequence, function, sub-routine, or module. Braces are used to mark its beginning and end. Procedure call invokes it, and procedures can have parameters.
Selection
Instruction that decides which sequence is executed based on a true/false condition.
Repetition
Repeats an instruction while or until a true or false condition occurs; also called iterations or loops.
Documentation (Algorithm)
Describes what the algorithm does.
Nested Selection
Inner condition is only checked if the outer condition is true. Used when the 2nd condition depends on whether the statement is true.
Cascaded Selection
Program checks conditions from top to bottom until it finds a true condition. Used when 2 or more conditions cannot all be true.

Pretest vs Posttest Loops
Pretest checks condition first before running (may run 0 times). Posttest runs once, then checks condition.
Structured English
Expressing your algorithm in plain English through a numbered sequence.
Pseudocode
Describing the steps in your algorithm by incorporating logical symbols and operators.
Flowchart
Pictorial representation of algorithms.
Six Basic Computer Operations
Algorithm vs Program
Algorithm is for talking to humans (plain language, pseudocode, or flowcharts). Program is for talking to computers ("Formal Expression" of an algorithm).
Linker
Assembles all functions into a final executable program.

Basic Structure of a C Program
Consists of library inclusion #include <stdio.h>, main function declaration int main(), braces enclosing instructions, and return 0;.
Modulo Operator
Denoted by \%; calculates the remainder of division.
Integer Division Rule
If you divide 2 integers, the program will not round.
Comments in C
Syntax: /*Comment*/. Comments do not nest.
ASCII Values Range
Range from 0 to 127. Capital letters: A(65) to Z(90). Small letters: a(97) to z(122).
Identifiers
Names of variables. Qualities: Any letter, number, or _; cannot start with a digit; not a keyword; case-sensitive.
Boolean Values in C
Either true (1 or any non-zero integer) or false (0).
Operator Precedence
Order: Brackets > Arithmetic > ! > < > <= >= > == > != > && > || > =.
Stream
Sequence of characters that acts as a channel between your program and I/O devices (e.g. keyboard, monitor), organized into lines that end with \n.
Standard Streams
stdin: Standard input (e.g. keyboard); stdout: Standard output (e.g. monitor); stderr: Standard error (e.g. monitor).
scanf()
Reads data from stdin. Syntax: scanf("[conversion specifiers]", &[variable type]);. Don't use & when reading strings.
printf()
Writes data from stdout. Syntax: printf("[literals and conversion specifiers]", variable). Don't use & in variable types.
Conversion Specifiers
%d and %i (Integers), %f (Float), %e (Float in exponential form), %c (Character), %s (String), %x (Hexadecimals), %o (Octals), %% (Prints literal %).
Text file vs Binary File
Text file (.txt): Stores data as ASCII characters, ends lines with \n. Binary File (.bin): Stores data in raw binary format (0s and 1s), created and read through C programs.

Steps for File Processing
fopen(); 2. Read/write data using standard file stream functions; 3. Close the file stream using fclose().
fopen()
Opens a file stream. Syntax: FILE *fptr = fopen ("filename", "mode");. Text Modes: r/rt (read), w/wt (write), a/at (append). Binary Modes: rb (read), wb (write), ab (append).

fclose()
Closes a file stream. Syntax: fclose (fptr);. Releases the file pointer and saves changes.
fprintf()
Functions like printf(), but takes the file pointer as its first argument to write formatted output to a file stream.
fscanf()
Functions like scanf(), but reads input from a file pointer instead of standard console input.