CSE 1341: CS I (Fall, 1999)
Topics Covered before Exam#1
Tuesday, 8/24/99
- Introduction: course and people.
- General information about the course.
- Rules, policies, and responsibilities.
- Lab information.
- Contents and tentative schedule.
- Other things listed on course syllabus.
- General questions?
- hw#1
- Introduction to computing:
- Pre-modern: attempt at automating math and problem solving
- G1: vacuum tubes and direct manipulation/machine code
Thursday, 8/26/99
- Intro to computing (continued)
- G2: transistors and assembly language
- G3: IC and high level language
- G4: VLSI and different types of computers/systems
- Internet and WWW
- Range of computers
- super-computers
- mainframes
- mid-range
- mini/workstations
- PC/micro
- special purpose controllers/processors
- Computer organization:
- CPU (central processing unit) or processor
- I/O (input/output devices)
- storage
(internal memory and external/secondary storage)
- Computer Science: basic theory and principles
Areas within CS:
- algorithm, theory of computation, complexity,
- data structure, database,
- programming languages, computing environment
- HCI (human computer interaction),
graphics and GUI (graphical user interfaces),
- numerical analysis, scientific computation,
- AI (artificial intelligence), etc.
- Computer Engineering: hardware and computer system/network
Areas within CE:
- hardware/component design and engineering
- systems design and analysis
- computer organization/architecture
- distributed systems
- network
- operating systems (OS) and system software, etc.
- Software Engineering: developing/maintaining large software systems
- More questions about hw#1?
Tuesday, 8/31/99
- More questions about hw#1?
- Languages and programming/software development:
- object/executable code
- source code
- assembly languages: assemblers
- high level languages: compilers and interpreters
- compiler example: gccx
- interpreter examples: UNIX shell, Lisp interpreter
- Introduction to C and UNIX
- using gccx:
- gccx hello.c
- gccx -o hello hello.c
- Example of C programs:
- hello.c: message printing
- "gccx" compiler, -> "a.out": executable
- greeting.c: simple input/output handling.
- add2.c: numerical computation
- Common elements in C programs (so far)
- #include: standard vs user defined header files
- file header: author, date/history, functionality descriptions
- main()
- use of space and indentation for program documentation
- hw#2
Thursday, 9/2/99
- hw#2
- Programming process:
- problem analysis
- algorithmic design
- coding (in a high level language)
- compiling and debugging
- documentation/report and solution
Mapping to CS:
- see list of areas with CS (previous class)
- Software development process:
- requirement analysis
- product specification
- design (high/low level)
- implementation
- testing
- release and support/maintenance
Documentation and quality assurance throughout the process.
Development methods: structured and object-oriented programming.
Mapping to SE:
- process, ISO 9000, SEI/CMM
- measurement and analysis,
- requirement engineering,
- design/analysis methods,
- testing and quality assurance,
- maintenance,
- CASE (computer aided software engineering) tools,
etc.
- C language overview
- origin, connection to UNIX, and popularity
- evolution, ANSI C, and connections to C++
- overall structure of C programs
- example programs: hello.c, greeting.c, add2.c
- files: ".c" and ".h" types
- #include: standard vs user defined header files
- functions, no nesting
- file header: author, date/history, functionality descriptions
- main()
- functions (later)
- statements: assignment, I/O, decision, loops
- use of space and indentation for program documentation
Tuesday, 9/7/99
- more questions about hw#2?
- information presented in a clear, readable way
- consistent usage of space and indentation
- data types: domain & operations
- string constant in "hello.c"
- strings in "greeting.c"
- integers (int) in "add2.c"
- floating-point data (double) in "add2f.c" and "ave2f.c"
- variables vs. constants
- (un-named) constants: integer, floating-point, strings.
- operators and operands
- operands: constants, variables, functions
- mathematical operators:
- "/" and "%":
- re-write "cmtofeet.c" using "/" and "%"
(see "cm2ft.c").
- operator precedence rules and the use of "(" and ")"
- not available in C: how to implement
- simple operators
- library for more complex operators
- other operators (logical, etc.) later
- expressions and assignments
- single type
- mixed types: interpretation and conversions
- implicit conversion (size-up)
- explicit casting
- in assignment, convert to lhs
- hw#3
Thursday, 9/9/99
- questions about hw#3?
- standard test values
- correct data types
- hw#2: emphasis on I/O and simple calculation (not data types)
- variables (and constants, and functions) names: rules, legal vs. good
- letters, numbers, and "_"
- leading character: letter ("_" for system functions/variables)
- trailing characters and length
- keywords/reserved words in C (p.39)
- capitalization: case sensitive,
but all capital (e.g. PI, BUF_SIZE) usually denotes constants
- meaning of names
- other "good style" guidelines:
simplicity, avoiding keywords/constant/function-like names,
C++ keywords.
- Chapter 3: learning by examples and problem solving paradigm
- in class: Chapters 3 & 4 together
- some commonly used idioms in C
- input-compute-output idiom:
- prompt
- input operation
- computing
- result output
- function calls and arguments/parameters in the above idiom:
- printf(), match by position
- example in "cmtofeet.c" and "inchtocm.c" from Chapter 2
- other calls: GetInteger(), GetReal(), etc.
- some commonly used shorthand idioms in C
- increment and decrement: ++ and --
- pre/post operation of ++ and -- in embedded statements
- assignment: +=, -=, *=, /=.
- control flow for procedural languages: flow charts
- sequential statements
- conditional branching
- loops
- batch processing (input-compute-output) vs. interactive processing
- conditions and "if"
- example programs:
- sign1.c
- sign2.c
- signtest.c, Figure 4-3, p.115 (Chapter 4)
- if (condition) statement;
- if (condition) {statementT} else {statementF}
- expressions in comparison:
- "oddeven.c" from Chapter 4
- "else" and "else if" (more later)
Tuesday, 9/14/99
- More questions about hw#3?
- comparison/relational operators: >, >=, <, <=, ==, !=.
- the need to handle more numbers/information
- deterministic vs. non-deterministic loops
- loop examples and concept
- "add10.c" from Chapter 3
- "addlist.c" from Chapter 3
- "addw.c".
- flow-chart
- iteration: process of repeating a set of operations
- loop: control and body
- loop index and bound(s)
- initialization
- repeat-N-times idiom: "for" statement
- "for" syntax/flow-chart
- initialization/control/update together
- update after loop body
- "add10.c" vs. "add10w.c".
- read-until-sentinel idiom: "while" statement
- "while" syntax/flow-chart
- explicit "break" vs. exit from loop control
- conditions used directly in "while"
- converting "for" <=> "while"
- "add10.c" vs. "add10w.c":
- initialization
- update/step
- some field(s) may be empty in "for"
- hw#4
Thursday, 9/16/99
- questions about hw#4?
- design decisions: sentenial vs. explicit end?
- difference between target and tolerance
- debugging exercise (Sec. 3.4)
- inspection: syntax and semantics
- testing: input/output relation, path
- formal verification
- output formatting in "printf()"
- format code (p.82): d, f, e, g, s, %
- parameter matching by place
- spacing: implicit vs. explicit number
- alignment: right (default) vs. left (-)
- precision (.)
- programming style (pp.86-88),
relating to homework assignments
- comments and documentation
- presentation: spacing and indentation
- consistent style/format
- meaningful names and naming conventions
- standard idioms and conventions
- avoid un-necessary complexity
- use of named constants (liftoff.c)
- advantage for program understanding
- advantage in program maintenance
- truth values
- standard C: 0 for false, non-0 for true
- boolean type in textbook
- logical operators: and, or, not
- C language: &&, ||, !
- differentiate from: &, |
- truth table
- use in programs: leapyear.c (ch.4)
Tuesday, 9/21/99
- more questions about hw#4?
- short circuit evaluation
- more about "if"
- relation/comparison operators
- logical operators: &&, ||, !.
- other conditions: 0 and non-0
- "else" and "else if"
- nested if's
- nested if vs. compound conditions
- "else if" and "switch ... case"
- "switch-case" syntax/flow-chart
- comparison with cascading "else if"s
- sample programs from chapter 4:
- if: oddeven.c
- switch: cardrank.c
- compound conditions: leapyear.c
- nested if: lpyr.c
- check the equivalence of logic in "leapyear.c" and "lpyr.c" above
- statements (Chapter 4)
- simple statements
- embedded statements: use with caution
- multiple assignments: use with caution
- blocks: implicit vs. explicit
- control statements: conditionals vs loops
- "if" statement vs. "switch" statement
- "while": "loop-and-a-half" problem ("addlist.c" vs. "addw.c" before)
- "for": single point of control (initialization/condition/update)
- multiple statements: using matching "{" and "}"
- how to match "{" with "}":
- indentation rules, align pairwise (2nd variation in textbook)
- editing: "match-then-fill" strategy
- precedence table (p.131)
- IT overview
Thursday, 9/23/99
- Information and society
- social issues
- impact on society
- program/software specifics
- Ethics
- professional ethics
- professional/social responsibilities
- IEEE and ACM code of ethics
Tuesday, 9/28/99
- Microsoft/commonly used PC/Computer utilities
- spreadsheet/worksheet: MS Excel
- cell and cell manipulation
- formula and formula replication
- functions: commonly used, statistics, logical, etc.
- relative and absolute addressing
- advanced: chart and other utilities
- hw#6
- continuation of IT issues and ethics.
Thursday, 9/10/99
- Microsoft/commonly used PC/Computer utilities
- document processing/formatting software
- WYSIWYG or not?
- MS Words
- LaTeX
- HTML
- example documents
- comparison:
- learning curve
- consistency and functionality
- different views of the document
- exam review
Tuesday, 10/5/99
Prepared by Jeff Tian
(tian@seas.smu.edu).
Last update Sep. 28, 1999.