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:
  1. Use the Emacs editor to author (open, edit, and save) complete C program files.
  2. Execute basic commands to navigate in the terminal (i.e., cd, ls, pwd, cp, rm, mv)
  3. Use make in the terminal to compile C program files using the MyroC library
  4. Use clang (and make) in the terminal to compile C program files without MyroC
  5. Write a complete C programa including necessary header files and a main function with valid signature "int main(void)" and return statement
  6. Declare variables and initialize or assign them values
  7. Use the const type modifier to declare non-mutability of variables (i.e., constants)
  8. Abstract common, repeated, or high-level operations into separate procedures
  9. Practice incremental program development by outlining and stubbing procedure skeletons
  10. Write comments for code and documentation for procedures
  11. Write basic programs using the MyroC library involving robot connection, beeping, and motion (with MyroC documentation provided)
  12. 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:
  1. 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)
  2. Use arithmetic operations (+, -, *, /, %) in expressions with variables or literals
  3. Use assignment operators to (=, +=, -=, *=, /=, %=) bind values to variables
  4. Use increment (++) and decrement (--) operators to modify variables
  5. Evaluate C expressions using appropriate precedence, associativity, and type conversion rules (whether implicit through assignment or explicit through casting)
  6. Evaluate expressions and assignments using either prefix or postfix increment and decrement operators
  7. Trace a program using the stack model of computation
  8. Understand scope by giving the value of a variable in a context, even when there are multiple variables with the same name
  9. Use expressions with boolean operators (&& , ||, !) and relational comparison (<, >, <=, >=) and equality (==, !=) operators
  10. Write programs involving conditional behavior with if and switch statements
  11. Write programs with looping behavior using while, do while, and for loop statements
  12. Use break to interrupt control flow in switch and loop statements
  13. 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:
  1. Write functions that accept parameters and/or return a value
  2. Document preconditions and postconditions
  3. Use the assert procedure to verify program state meets expectations
  4. Write a test plan using black-box or white-box testing
  5. Declare pointer variables using the * type modifier
  6. Initialize or assign pointer variables using the address operator &
  7. Use pointers to pass references to variables as function parameters
  8. Use the indirection operator * to dereference pointers to read or assign values, potentially across different scopes (stack frames)
  9. Draw and interpret stack (schematic memory) diagrams involving pointers, including both addresses as values and arrows
  10. Declare array variables of a given length
  11. Initialize array variables with their declaration
  12. Use the subscripting operator [] to read or assign values in arrays
  13. Use the #define preprocessor directive to specify constants for use as array lengths
  14. 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
  15. Use pointer arithmetic to access relative locations in memory (e.g., arrays)
  16. Use the -D flag with clang and CPPFLAGS option with make to define values for the preprocessor
  17. Write safe parameterized preprocessor macros
  18. Use #if, #ifdef, #ifndef, and #end preprocessor macros for conditional compilation
  19. Use the # "stringization" preprocessor operator on a parameterized macro token.
  20. Compile with the -g flag to enable debugging symbols
  21. Start the GNU Debugger GDB for an executable in Emacs and the command line
  22. Use watchpoints and breakpoints to pause execution during program debugging
  23. Navigate the stack using the GDB commands up and down
  24. Use (and understand the differences between) the GDB commands step, continue, and next for controlled execution
  25. 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:
  1. Convert positive numbers between decimal (base 10) and binary (base 2)
  2. Add two numbers expressed in binary
  3. Convert negative decimal numbers between binary sign magnitude, ones complement, or twos complement representations
  4. Explain the meaning of the sign, exponent, and mantissa fields of a floating point value
  5. 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.
  6. Convert a decimal number to its floating point representation in binary when provided with the field boundaries or widths and the exponent bias
  7. 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:
  1. Initialize character arrays as strings and initialize character pointers with string literals
  2. Understand the relationship between strlen and the null character terminator '0'
  3. Use scanf to
    1. read numeric input in integer or floating point format
    2. read string input in a memory-safe fashion using the %Ns format specifier to limit input to buffer capacity
  4. Compare strings using strcmp
  5. Use getchar to read input character-by-character
  6. Use fgets to read input line-by-line
  7. 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:
  1. Declare structure types with a struct tag
  2. Declare structure variables
  3. Use typedef to declare a (shorthand) type name for tagged struct types.
  4. Initialize structure variables at declaration
  5. Access structure variable members using the dot operator (.)
  6. Use structure variables in ordinary contexts
  7. Pass structures as arguments to functions (including as values in an array)
  8. Return structures from functions
  9. Pass structure pointers to functions
  10. Access structure pointer members using the dereferencing operator (*) in combination with the dot operator
  11. Declare and initialize 2D arrays
  12. Access a specific item in a 2D array using two array subscripting operators ( [][] )
  13. Pass a 2D array to a function specifying the array width with a global constant or a function parameter
  14. 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:
  1. Use malloc to allocate memory from the heap
  2. Use free to return memory to the heap
  3. Use AddressSanitizer to produce programs that are free of memory errors
  4. Use the -> operator to access a structure member through a pointer
  5. Use a "pointer to a pointer" ("double pointer") argument to a function to modify what a pointer points to
  6. Implement a linked list data structure with dynamic node allocation and de-allocation
  7. Write utility functions for a linked list data structure
  8. Separate programs into a function library with an accompanying header file (featuring an include guard) and a client program that utilizes the library
  9. Give separate commands to
    • compile a source file into an object file
    • link multiple object files into a single executable
  10. 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:
  1. Understand how the push, pop, and top operations function for a stack abstract data type (FILO)
  2. Understand how the enqueue, dequeue, and front operations function for a queue abstract data type (FIFO)
  3. Implement stack or queue ADT operations using either a linked list or an array
  4. 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:
  1. Process command-line arguments to main using argc and argv.
  2. Convert strings to integers or doubles using atoi and atof.
  3. Use stdin, stdout, and stderr file stream pointers for I/O
  4. Open a file stream pointer (in many possible modes, including read, write, append, and/or binary) using fopen
  5. Check for file stream status or I/O errors using feof, ferror
  6. Print diagnostic error messages using perror and strerror
  7. Use fprintf and fscanf for text-based file stream pointer I/O
  8. Use fread and fwrite for binary I/O
Last updated: Dec 13, 2024