Course Learning Outcomes
CSC 161 - Imperative Problem Solving - Weinman
- Summary:
- Things you should learn in each module.
Module 0
At the end of this unit you should be able to:
- Use the Emacs editor to author (open, edit, and save) complete C program
files.
- Execute basic commands to navigate in the terminal (i.e., cd,
ls, pwd, cp, rm, mv)
- Use make in the terminal to compile C program files using
the MyroC library
- Use clang (and make) in the terminal to compile
C program files without MyroC
- Write a complete C programa including necessary header files and a
main function with valid signature "int main(void)"
and return statement
- Declare variables and initialize or assign them values
- Use the const type modifier to declare non-mutability of
variables (i.e., constants)
- Abstract common, repeated, or high-level operations into separate
procedures
- Practice incremental program development by outlining and stubbing
procedure skeletons
- Write comments for code and documentation for procedures
- Write basic programs using the MyroC library involving robot connection,
beeping, and motion (with MyroC documentation provided)
- Display terminal output from a C program using printf, including
formatting decimal integer values (int) and floating point
values (float or double).
Module 1
At the end of this unit you should be able to:
- Choose the appropriate variable type for a value from among the standard
C numeric types, integer (bool, char, short,
int, long) and floating point (float and
double)
- Use arithmetic operations (+, -, *, /,
%) in expressions with variables or literals
- Use assignment operators to (=, +=, -=,
*=, /=, %=) bind values to variables
- Use increment (++) and decrement (--) operators
to modify variables
- Evaluate C expressions using appropriate precedence, associativity,
and type conversion rules (whether implicit through assignment or
explicit through casting)
- Evaluate expressions and assignments using either prefix or postfix
increment and decrement operators
- Trace a program using the stack model of computation
- Understand scope by giving the value of a variable in a context, even
when there are multiple variables with the same name
- Use expressions with boolean operators (&& , ||,
!) and relational comparison (<, >, <=,
>=) and equality (==, !=) operators
- Write programs involving conditional behavior with if and
switch statements
- Write programs with looping behavior using while, do
while, and for loop statements
- Use break to interrupt control flow in switch and
loop statements
- Use the MyroC library to get robot sensor readings (with MyroC documentation
provided)
Module 2
At the end of this unit you should be able to:
- Write functions that accept parameters and/or return a value
- Document preconditions and postconditions
- Use the assert procedure to verify program state meets expectations
- Write a test plan using black-box or white-box testing
- Declare pointer variables using the * type modifier
- Initialize or assign pointer variables using the address operator
&
- Use pointers to pass references to variables as function parameters
- Use the indirection operator * to dereference pointers
to read or assign values, potentially across different scopes (stack
frames)
- Draw and interpret stack (schematic memory) diagrams involving pointers,
including both addresses as values and arrows
- Declare array variables of a given length
- Initialize array variables with their declaration
- Use the subscripting operator [] to read or assign values
in arrays
- Use the #define preprocessor directive to specify constants
for use as array lengths
- Explain why changing a value in an array passed as a function argument
has an effect on the array values as seen by the caller
- Use pointer arithmetic to access relative locations in memory (e.g.,
arrays)
- Use the -D flag with clang and CPPFLAGS
option with make to define values for the preprocessor
- Write safe parameterized preprocessor macros
- Use #if, #ifdef, #ifndef, and #end
preprocessor macros for conditional compilation
- Use the # "stringization" preprocessor operator on a
parameterized macro token.
- Compile with the -g flag to enable debugging symbols
- Start the GNU Debugger GDB for an executable in Emacs and the command
line
- Use watchpoints and breakpoints to pause execution during program
debugging
- Navigate the stack using the GDB commands up and down
- Use (and understand the differences between) the GDB commands step,
continue, and next for controlled execution
- Print expressions and variable/parameter values using GDB commands
print and info
Data Representation
At the end of this unit you should be able to:
- Convert positive numbers between decimal (base 10) and binary (base
2)
- Add two numbers expressed in binary
- Convert negative decimal numbers between binary sign magnitude, ones
complement, or twos complement representations
- Explain the meaning of the sign, exponent, and mantissa fields of
a floating point value
- Express the numerical interpretation of a floating point value given
in binary representation when provided with the field boundaries or
widths and the exponent bias; for example
-
1 : 10000111 : 00101100000000000000000
with bias 127 should be read as −1.0010112×2135−127
, which is (20+2−3+2−5+2−6)×28 or
(1+[1/8]+[1/32]+[1/64])×28.
- Convert a decimal number to its floating point representation in binary
when provided with the field boundaries or widths and the exponent
bias
- Use bitwise operations (& , |, ^,
~, << , >> ) to set, clear, toggle,
or read out specific bit(s)
Module 3
At the end of this unit you should be able to:
- Initialize character arrays as strings and initialize character pointers
with string literals
- Understand the relationship between strlen and the null character
terminator '0'
- Use scanf to
- read numeric input in integer or floating point format
- read string input in a memory-safe fashion using the %Ns
format specifier to limit input to buffer capacity
- Compare strings using strcmp
- Use getchar to read input character-by-character
- Use fgets to read input line-by-line
- Verify input by checking return values of (scanf, getchar,
fgets) and/or the pointer values assigned (scanf,
fgets)
Module 4
At the end of this unit you should be able to:
- Declare structure types with a struct tag
- Declare structure variables
- Use typedef to declare a (shorthand) type name for tagged
struct types.
- Initialize structure variables at declaration
- Access structure variable members using the dot operator (.)
- Use structure variables in ordinary contexts
- Pass structures as arguments to functions (including as values in
an array)
- Return structures from functions
- Pass structure pointers to functions
- Access structure pointer members using the dereferencing operator
(*) in combination with the dot operator
- Declare and initialize 2D arrays
- Access a specific item in a 2D array using two array subscripting
operators ( [][] )
- Pass a 2D array to a function specifying the array width with a global
constant or a function parameter
- With appropriate MyroC documentation:
- Use rLoadPicture, rTakePicture, and rShowPicture
for image-related processing
- Set and/or modify Pixel structures in a Picture
structure
Module 5
At the end of this unit you should be able to:
- Use malloc to allocate memory from the heap
- Use free to return memory to the heap
- Use AddressSanitizer to produce programs that are free of memory errors
- Use the -> operator to access a structure member through
a pointer
- Use a "pointer to a pointer" ("double pointer") argument to
a function to modify what a pointer points to
- Implement a linked list data structure with dynamic node allocation
and de-allocation
- Write utility functions for a linked list data structure
- Separate programs into a function library with an accompanying header
file (featuring an include guard) and a client program that utilizes
the library
- Give separate commands to
- compile a source file into an object file
- link multiple object files into a single executable
- Create a Makefile that can compile individual source files
and link multiple object files using separate targets as appropriate,
specifying the necessary dependencies and rules
Module 6
At the end of this unit you should be able to:
- Understand how the push, pop, and top operations function for a stack
abstract data type (FILO)
- Understand how the enqueue, dequeue, and front operations function
for a queue abstract data type (FIFO)
- Implement stack or queue ADT operations using either a linked list
or an array
- Reason about memory "ownership" for strings (i.e., when are pointers
stored, versus when is a string copied into an array), and its implications
for data management in container ADT add/remove methods such as push
and dequeue.
Module 7
At the end of this unit you should be able to:
- Process command-line arguments to main using argc
and argv.
- Convert strings to integers or doubles using atoi and atof.
- Use stdin, stdout, and stderr file stream
pointers for I/O
- Open a file stream pointer (in many possible modes, including read,
write, append, and/or binary) using fopen
- Check for file stream status or I/O errors using feof, ferror
- Print diagnostic error messages using perror and strerror
- Use fprintf and fscanf for text-based file stream
pointer I/O
- Use fread and fwrite for binary I/O
Last updated: Dec 13, 2024