[CSC 171] - Midterm Exam Guide - Comprehensive Notes for the exam (17 pages long!)

128 views17 pages

Document Summary

Step-by-step procedures to perform some task (e. g. , sorting a list) Each step in an algorithm is something the executor already knows how to do (e. g. , swap two elements) Recipes for telling computers how to do things. Built out of things that the computer already knows how to do. A program is an encoding of an algorithm in a language that a computer can understand and execute. Translate your vision of what needs to be done (algorithm) into terms the computer can understand (program) Electricity: off or on binary numbers: 0 or 1 machine code. Electricity: off or on binary numbers: 0 or 1 machine code assembly language. A program is a sequence of statements. Statements tell the computer what to do when it executes them. Statements are executed sequentially (one after the other) Statements use values computed by the compute. Primitive: numbers (integers and reals), characters, booleans. Expressions tell the computer how to compute a value.