CompE160 Introduction to Programming

advertisement
CompE160 Introduction to Programming
Marino
Fall 2010
CompE160 Lecture Schedule – Fall 2010 (Tentative)
Day Reading
1
Preface
2
3
Ch. 1;
UNIX online help
Ch. 2;
App. D
4
Ch 2
5
Ch. 2, 3
6
Ch. 3
7
8
Ch. 3, 9
Ch. 3
9
Ch. 4
10
Ch. 4
11
Ch 3, 4, 9
12
13
14
15
Ch. 5 (skip
recursion)
Ch. 5
16
Ch. 5
Library
handout
Ch. 5
17
Ch. 6
Topics1
Course introduction. Jason server. Linux and XWin32
workstations. UNIX command line interface and GUI.
Computer Organization; information; P-M-D-IO model;
operating systems; file fundamentals. Unix.
Information representation: types of information (numbers,
text, instructions); integer codes (unsigned B2; signed 2C);
program development; printf.
C integer data types. Declaration statement. Assignment
statement. Arithmetic operators. Ranges of integer codes.
Integer overflow. Simple expressions. Precedence and
associativity. scanf.
Selection structures: if; if..else; if..else if …. Relational
operators. Logical operators.
Real C data types. Floating-point codes: representation
error; range and precision; real division; comparisons. Math
library. #define directive. Program errors.
Accessing Jason from home. Formatting printf output.
Mixed expressions, promotions, casts. Combined assignment
operators. ++ and -- operators. Use of integer data types to
represent Boolean values. The switch selection structure.
Iteration/loop concept. C while statement. Loop design
considerations: loop variables; loop initialization; loop work;
loop exit test
Exhaustive-search algorithms. Iteration statements: for and
do-while. Conditional operator ( ?:); break and continue
statements.
Miscellaneous topics: whitespace and style; #define;
#include.
Review. Sample exam.
Midterm Exam 1
Functions: concept; syntax and terminology; examples.
Function call mechanics: providing input information and
returning result. Scope and duration of variables.
Library functions. Math library. Standard IO library.
Standard Library: rand, srand. Simulation. Scope and
lifetime: local, global and static variables.
Arrays: concept; syntax. Using an array in Lab 9 (die
CompE160 Introduction to Programming
18
19
20
Ch. 6 (skip
2D arrays)
Ch. 6
Ch. 7
21
Ch 7
22
23
24
25
Ch. 8.
App. C
Ch. 8
26
27
Sec 11.111.5
28Final
Marino
Fall 2010
simulation). Using return value of scanf in loop exit test.
Arrays as function parameters (address parameters).
Sorting algorithms: bubble sort; selection sort
Pointers: concept; syntax. Address and dereferencing
operators. Use of pointers as function parameters: swap
function.
Pass by value and pass by reference. Arrays as function
parameters: equivalence of array and pointer notation.
Memory simulation of pass by reference.
Midterm Review
Midterm Exam 2
char data type – used for characters or integers.
Representing character values (e.g., ‘A’). Character
handling library.
Strings: concept; syntax. Notation for string constant (e.g.,
“Tom Jones”). Initialization of char array in declaration. Use
of character array to store strings. Strings as function
parameters. String library. const parameters.
String demos
File io
Review
Final Exam: Saturday 5/16 1300-1500
1. Only major topics are listed. Student is responsible for all topics covered in the assigned reading.
Download