Computer Programming CS 102 Midterms Reviewer

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

1/48

flashcard set

Earn XP

Description and Tags

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.

Last updated 12:07 PM on 10/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

49 Terms

1
New cards

Computer Programming

Writing instructions and giving them to the computer to complete a task (i.e. software).

2
New cards

Operating System

Manages computer hardware and software resources.

3
New cards
<p>Compilers and Interpreters</p>

Compilers and Interpreters

Translate high-level code into machine language.

4
New cards

Applications

Executes a specific user-driven task.

5
New cards

Embedded Systems

Controls the physical hardware of a dedicated device.

6
New cards

Compiler

Translates the whole program once before executing.

7
New cards

Interpreter

Translates and executes the program one line at a time.

8
New cards

Source Code

Human-understandable program.

9
New cards

Object Code

Machine-understandable program.

10
New cards

Problem-Solving Phase

The initial phase of programming consisting of Defining Problem (determine program function and requirements) and Designing Program (make an algorithm).

11
New cards

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).

12
New cards

High-Level Language

Uses English-like words, mathematical symbols, and familiar syntax.

13
New cards

Low-Level Language

Interacts directly with the CPU, registers, and memory addresses.

14
New cards

Algorithm

A sequence of instructions describing how to do a task.

15
New cards

Values and Variables

Values may be any quantities, measurements, or data. Variables contain values.

16
New cards

Instructions (Algorithm)

Action that is simple (primitives); manipulates/controls the variable or value.

17
New cards

Sequence

A series of instructions.

18
New cards

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.

19
New cards

Selection

Instruction that decides which sequence is executed based on a true/false condition.

20
New cards

Repetition

Repeats an instruction while or until a true or false condition occurs; also called iterations or loops.

21
New cards

Documentation (Algorithm)

Describes what the algorithm does.

22
New cards

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.

23
New cards

Cascaded Selection

Program checks conditions from top to bottom until it finds a true condition. Used when 22 or more conditions cannot all be true.

24
New cards
<p>Pretest vs Posttest Loops</p>

Pretest vs Posttest Loops

Pretest checks condition first before running (may run 00 times). Posttest runs once, then checks condition.

25
New cards

Structured English

Expressing your algorithm in plain English through a numbered sequence.

26
New cards

Pseudocode

Describing the steps in your algorithm by incorporating logical symbols and operators.

27
New cards

Flowchart

Pictorial representation of algorithms.

28
New cards

Six Basic Computer Operations

  1. Receive inputs; 2. Output information; 3. Perform arithmetic operations; 4. Assign value; 5. Compare information; 6. Repeat actions.
29
New cards

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).

30
New cards

Linker

Assembles all functions into a final executable program.

31
New cards
<p>Basic Structure of a C Program</p>

Basic Structure of a C Program

Consists of library inclusion #include <stdio.h>, main function declaration int main(), braces enclosing instructions, and return 0;.

32
New cards

Modulo Operator

Denoted by \%; calculates the remainder of division.

33
New cards

Integer Division Rule

If you divide 22 integers, the program will not round.

34
New cards

Comments in C

Syntax: /*Comment*/. Comments do not nest.

35
New cards

ASCII Values Range

Range from 00 to 127127. Capital letters: A(6565) to Z(9090). Small letters: a(9797) to z(122122).

36
New cards

Identifiers

Names of variables. Qualities: Any letter, number, or _; cannot start with a digit; not a keyword; case-sensitive.

37
New cards

Boolean Values in C

Either true (11 or any non-zero integer) or false (00).

38
New cards

Operator Precedence

Order: Brackets > Arithmetic > ! > < > <= >= > == > != > && > || > =.

39
New cards

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.

40
New cards

Standard Streams

stdin: Standard input (e.g. keyboard); stdout: Standard output (e.g. monitor); stderr: Standard error (e.g. monitor).

41
New cards

scanf()

Reads data from stdin. Syntax: scanf("[conversion specifiers]", &[variable type]);. Don't use & when reading strings.

42
New cards

printf()

Writes data from stdout. Syntax: printf("[literals and conversion specifiers]", variable). Don't use & in variable types.

43
New cards

Conversion Specifiers

%d and %i (Integers), %f (Float), %e (Float in exponential form), %c (Character), %s (String), %x (Hexadecimals), %o (Octals), %% (Prints literal %).

44
New cards

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 (00s and 11s), created and read through C programs.

45
New cards
<p>Steps for File Processing</p>

Steps for File Processing

  1. Open file stream using fopen(); 2. Read/write data using standard file stream functions; 3. Close the file stream using fclose().
46
New cards
<p>fopen()</p>

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).

47
New cards
<p>fclose()</p>

fclose()

Closes a file stream. Syntax: fclose (fptr);. Releases the file pointer and saves changes.

48
New cards

fprintf()

Functions like printf(), but takes the file pointer as its first argument to write formatted output to a file stream.

49
New cards

fscanf()

Functions like scanf(), but reads input from a file pointer instead of standard console input.