CMPSC 201 - Ch. 3 Resources

Lecture Notes (data types, expressions)

Demo Program #1 - Declaring and using constants

Demo Program #2 - Correct the errors in this program

Demo Program #3 - Implicit and explicit conversion (promotion & typecasting)

Demo Program #4 - Int and char datatypes and typecasting

Demo Program #5 - rounding to a decimal place

Demo Program #6 - using setprecision, setw, etc.

Demo Program #7 - a rounding algorithm that works for positive and negative values

Ch. 3 Worksheet #1 - variable names, initialization, & assignment

Ch. 3 Worksheet #2 - operators, expressions, typecasting


CMPSC 201 Home Page