CGSC 1005 Lecture Notes - Lecture 2: Pseudocode, Mental Model, Hard Coding
Document Summary
Algorithm a high level recipe for solving a specific problem, not written in a programming language, algorithm for sorting. Program corresponds to instructions (code) that specify how to perform the computation, written in programming language. Algorithms and variables: input(s, inputs are stored in memory and transformed into outputs, output(s) Manually simulating the execution of your code line by line python code print ( the sum of 4 and 5 is ) print (4+5) print ( good bye ) Determine what each line tells the program to do and how it should respond. Eol, invalid syntex tons of red text ex. Program gives 3 chances then locks up, but locks out after only 2, off by one print( hello ) print ( 9 / 0 ) (dividing by 0) error . Put statements on separate lines , don"t break up statements across lines.