CGSC 1005 Lecture Notes - Lecture 2: Pseudocode, Mental Model, Hard Coding

57 views3 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents