APCO 1P93 Lecture Notes - Lecture 5: Nipple, Init
Document Summary
Apco 1p93 lecture 5 - input, processing, and output ii. Programmers can define variable names following certain rules. Generally, the first character cannot be a number. Name a variable something that indicates what may be stored in it camelcase is popular naming convention. Variable assignment does not always have to come from user input, it can also be set through an assignment statement. The expression is normally stored in variables: set sale = price discount. For safety and to avoid logic errors, variables should be initialized to 0 or some other value. A named constant is a name that represents a value that cannot be changed. If a change to the value occurs, it only has to be modified in one place. Hand tracing is a simple debugging process for locating hard to find errors in a program. Involves creating a chart with a column for each variable, and a row for each line of code.