Lecture Summaries - Week 6
Jump To:
[Lecture Index |
Previous Week's Lectures |
Next Week's Lectures]
Topics covered:
- Why we need character data types as well as numeric data types.
- How do declare character variables.
- How characters are represented.
- How we can read and write characters with
scanf and printf.
- A simple program to echo its input using scanf and
printf
(charecho.c).
- How input buffering works.
- How and when we use character constants.
- How we can compare characters.
- A program to calculate a GPA that doesn't quite work
(gpa.c).
Reading: Chapter 4.1 (through page 70).
Topics covered:
- Why newlines in the input have to be processed.
- Fixing our previous program to calculate GPA
(gpa2.c).
- How recognizing the newline allows to process input line-by-line.
- An extended version that calculates GPAs, one per input line
(gpa3.c).
- How to convert upper- to lowercase and vice versa with toupper
and tolower.
- Why we have to process every character in the input.
- How we can deal with unexpected/undesirable input.
- How we can improve our functions to deal with unexpected/undesirable
parameters.
- Checking for bad parameters within the function.
- Indicating bad parameters by returning special values.
- Checking for these special values in the caller.
- How to put all this together.
- Extending calculatePoints to validate its parameters
(gpa4.c).
- How to simplify complicated ifs by using default values.
- A simplified calculatePoints
(gpa5.c).
- How to use printf's to print debugging information.
- A version of our GPA-program instrumented
to print debugging information
(gpa6.c).
Reading: (No new reading for this lecture).
[EE150 Home Page |
Top Of Page]