Class Crib Notes for CPSC 110 Brent Dingle
Monday, January 28, 2002
Reminders:
Homework is due today and tomorrow.
Quiz is Wed. and Thurs. in lab.
Input functions:
Read and Readln (mostly use Readln in this class)
Output functions:
Write and Writeln
Formatting numbers (of type real)
Assignment operator is :=
Type compatibility (example: real = int is ok, int = real is NOT)
Each line in a program is a statement.
3 Types of errors:
Example programs to demonstrate
the above based on the below:
PROGRAM AddTwo
VAR
n1, n2, sum : integer;
BEGIN
writeln(‘Enter two
numbers’);
readln(n1, n2);
sum := n1 + n2;
writeln(n1, ‘ plus ‘,
n2, ‘ = ‘, sum);
END.
Software Life Cycle – 6 Phases