COMPE 160
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
- Understand the fundamental principles of program organization and design.
- Be able to read and write C language programs.
Topics Covered
- History of the computing industry.
- Computer subsystems: processor, primary memory (RAM), secondary memory (disk); input-output devices.
- Operating system basics: file system; input-output services; communication services (telnet, ftp, web); GUI interface; command-line interface
- Program development process: editor; compiler; linker; source program; executable program
- Information representation: unsigned base 2 code; two's complement code; Ascii code; IEEE floating point code (optional); octal and hexadecimal notation.
- Program variables and declaration statements
- C data types: int, long, float, double, char; signed and unsigned versions
- Dual use of int data type for integer and boolean values
- Assignment statements.
- Arithmetic operators: +, -, *, / and %
- Arithmetic expressions: precedence; associativity; mixed data type; automatic conversion; casting.
- Relational operators: <, >, <=, >=, ==, and !=.
- Logical operators: &&, ||, and !
- Other operators: ++, --, conditional (_?_:_), combined assignment (+=, *=, etc.)
- Selection structures: if; if ... else; if ... else if ... else if ...; switch
- printf and scanf functions: conversion specifiers; string constants; formatting output (e.g., %12.4f); return value of scanf
- Iteration control structures (loops): while, for, do ... while; break and continue statements
- Keyboard buffer: maintained by OS to allow correction via backspace; effect on program execution.
- Exhaustive search algorithms
- Binary search algorithms
- Functions: function prototype; function definition; parameter variables; return type; function call; arguments of function call
- Memory simulation: what happens in memory when each statement of a program executes, especially statements involving a function call.
- Scope and duration of variables: local variables; global variables; static variables
- Program style: use of whitespace; naming variables and functions; comments; structure of a C program
- Preprocessor directives: #include, #define
- Math library functions: exp, sqrt, sin, cos, ...
- Random number generators and simulation; library functions rand, and srand
- Arrays: declaration; initialization; use as function parameters
- Bubble sort algorithm
- Selection sort algorithm
- Pointers: dereferencing operator *; address operator &; use as function parameters to provide “pass by reference”.
- Pass by value and pass by reference: concepts; memory simulation
- char data type: dual use for characters and integers; literal values (e.g., 'A', '\065', '\n'); library functions (islower, isalpha, ...)
- strings: relation to char arrays; terminating null byte; library functions (strcpy, strcmp, strcat, ...)
- arrays of string literals (e.g., char* days[] = {“Monday”, “Tuesday” …};)
- Text files: functions (fscanf, fprintf, fopen, fclose, feof);
- Binary files (optional)
Textbooks
C How to Program, Deitel and Deitel, Fifth Edition, 2007
Lab Resources: Lab with 37 workstations
Prepared by: Dr. Leonard R. Marino
