Introduction to Computer Programming

Catalog Description:   

Introduction to computer organization and operation.  Editors, compilers and operating systems. Binary representation of information. Fundamentals of computer programming using the C language.  Selection and iteration structures. Functions.  Arrays.  Pointers.  Fileio.  Scope and duration of variables.  Systematic design and development of computer programs.

Credits: 3.0

Class Schedule: 2 hours lecture; 3 hours lab

Prerequisite by topic: Algebra, Geometry, Trigonometry, Calculus

Prerequisite by course: Math150 (Calculus I)

Course Objectives          

  1. Understand the fundamental principles of program organization and design.
  2. Be able to read and write C language programs.

Topics Covered               

  1. History of the computing industry.
  2. Computer subsystems: processor, primary memory (RAM), secondary memory (disk); input-output devices.
  3. Operating system basics: file system; input-output services; communication services (telnet, ftp, web); GUI interface; command-line interface
  4. Program development process: editor; compiler; linker; source program; executable program
  5. Information representation: unsigned base 2 code; two's complement code; Ascii code; IEEE floating point code (optional); octal and hexadecimal notation.
  6. Program variables and declaration statements
  7. C data types: int, long, float, double, char; signed and unsigned versions
  8. Dual use of int data type for integer and boolean values
  9. Assignment statements.
  10. Arithmetic operators: +, -, *, / and %
  11. Arithmetic expressions: precedence; associativity; mixed data type; automatic conversion; casting.
  12. Relational operators: <, >, <=, >=, ==, and !=.
  13. Logical operators: &&, ||,  and !
  14. Other operators: ++, --, conditional (_?_:_), combined assignment (+=, *=, etc.)
  15. Selection structures: if; if ... else; if ... else if ... else if ...; switch
  16. printf and scanf functions: conversion specifiers; string constants;  formatting output (e.g., %12.4f); return value of scanf
  17. Iteration control structures (loops): while, for, do ... while; break and continue statements
  18. Keyboard buffer: maintained by OS to allow correction via backspace; effect on program execution.
  19. Exhaustive search algorithms
  20. Binary search algorithms
  21. Functions: function prototype; function definition; parameter variables; return type; function call; arguments of function call
  22. Memory simulation: what happens in memory when each statement of a program executes, especially statements involving a function call.
  23. Scope and duration of variables: local variables; global variables; static variables
  24. Program style: use of whitespace; naming variables and functions; comments; structure of a C program
  25. Preprocessor directives: #include, #define
  26. Math library functions: exp, sqrt, sin, cos, ...
  27. Random number generators and simulation; library functions rand, and srand
  28. Arrays: declaration; initialization; use as function parameters
  29. Bubble sort algorithm
  30. Selection sort algorithm
  31. Pointers: dereferencing operator *; address operator &; use as function parameters to provide “pass by reference”.
  32. Pass by value and pass by reference: concepts; memory simulation
  33. char data type: dual use for characters and integers; literal values (e.g., 'A', '\065', '\n'); library functions (islower, isalpha, ...)
  34. strings: relation to char arrays; terminating null byte; library functions (strcpy, strcmp, strcat, ...)
  35. arrays of string literals (e.g., char* days[] = {“Monday”, “Tuesday” …};)
  36. Text files: functions (fscanf, fprintf, fopen, fclose, feof);
  37. Binary files (optional)


C How to Program, Deitel and Deitel, Fifth Edition, 2007

Lab Resources: Lab with 37 workstations

Prepared by: Dr. Leonard R. Marino