CSCE 121 Notes fall 2016 complete lecture notes PDF

Title CSCE 121 Notes fall 2016 complete lecture notes
Course Introduction to Program Design and Concepts
Institution Texas A&M University
Pages 4
File Size 35.7 KB
File Type PDF
Total Downloads 87
Total Views 136

Summary

fall 2016 complete lecture notes...


Description

CSCE 121 - fall 2016 I/O - input - processor (memory) - output memory - stored in ram byte = 8 bits memory = sequence of locations address - number of the location object = memory region which specifies what info is stored and operations variable = object w name declaration = statement that gives a name to an object value = data item put into a variable declare/define/initialize

use memory diagrams to organize changes in code negative in binary - starts w 1 overflow = when number is too large type safety - static + dynamic, compiler finds all type safety violations and runtime system finds all safety violations software development process = analysis - design - implementation - repeat (tested)!! datatypes = int, long, float, double, char, string… pointers = variables whose value is the address in memory of another variable references = special variable that acts as alias to another control structures = sequence - selection - iteration

SELECTION: switch, values uses for comparisons, matching cases PROGRAMMING GOALS: correctness, efficient, robustness, readability, reuse, modularity. ITERATION: loops, termination conditions (while, for do/while) types of control = counting, sentinel, flag

types of errors = compile time error, runtime debugging is required while coding handle unexpected conditions with catch throws compound data = arrays, vectors arrays = not as safe, does not check for bounds, pointer, homogenous, check at index vectors = safe, checks for out of bounds parallel vectors = 2d vectors sorting selection sort / use temp variables to fill in space and compare search = linear uses collected data over time binary search = faster IO input device - device driver - input library - program - output - device driver - output device use stream model use cin/cout stream states overall configuration of information use good, eof, bad, fail manipulators integer formatting, indicate what input stream use scientific, fixed,

functions benefit: manageable parts, certain domains, readability, avoids copying, easy debugging check for error w inputs clear, ignore function anatomy: formal arguments, void, body blocks, returns valName use function calls and can be stored in variables working function:! stack frame contains parameters use memory diagrams to organize functions 2. use references in functions pass by reference, &. shouldn't change the value of the variable if this is used use const to not allow change don’t pass by large vectors/arrays functions cont. use memory diagrams to help w visualization

command line parameters argv - values argc - name of the program function signature (value parameters); 3 ways to handle error = throw catch try...


Similar Free PDFs