CPS 6, Ramm - Summer Semester I - 5/25/99 #4
- Announce
- Coint toss for Random Quiz #2
Chap 3: C++ Programs: Input/Process/Output
- So Far: Previous Programs Fixed, Once Written
- More typically:
- Input: information fed to program (yum yum)
- Process: information is processed (indigestion?)
- Output: results of processing displayed (oh oh !?)
- Divide and Conquer
- Iterative Enhancement
(Planning for our Multi-Story Building)
- The Input Stream
cin
cin >> person
- Extraction Operator
>>
- Variables/Objects
- Definition/Creation/Memory
Type/Class
type name;
type name1, name2, ... name N;
- Modify Paging Program
page2.cc
- Processing Numbers
Example: Collision at -40
tempscale.cc
- Type:
int Numbers
- max, min
- micros, workstations
- Type:
double Numbers
- Arithmetic Operators/Operands
- + addition
- - subtraction
- * multiplication
- / division
- % modulus/remainder
- Operator Precedence
- ( )
- *, /, %
- +, -
- left to right
- Automatic
int to double conversion
- Classes and Types
- Objects and Variables
- Balloon Example (need for labs)
use figures from book (pp. 99-104)
fly.out
- Information Hiding
- Member Functions
methods
actions
montgolvier.Descend(0);
- Balloon Example
fly.cc
- Header Files
- Interface Diagram
- Reading the Header File (p. 103)
- Public
- Private
- Private Variables: State
balloon.h
- Compiling and Linking