coding Flashcards
formal parameters
parameters within the brackets when first declaring a function/ procedure which hold the values that are later passed in
actual parameters
variables being passed into the function/ procedure when its called
global variables
have global scope and are accessible throughout whole program after declaration which is outside all functions
local variables
have local scope and are accessible only within the block of code where they were declared, like within a specific function or loop
disadvantage of global variables
overuse can lead to code that is error-prone and difficult to manage, especially when working with a team
advantage of local variables
prevents mistakes and ensures computer doesn’t use more memory than it needs to
function that converts character to ASCII code
ord
function that converts ASCII code to character
chr
modulus symbol and what it does
%
prints remainder
syntax errors
mistake in spelling or grammar of code
prevent translation of source code into machine code
logic errors
mistake in way code is supposed to work
code runs but gives wrong results
can find by doing dry runs or using trace tables
execution errors
mistakes that show while program running
code asking to do something impossible or wrong
dry runs
manually working through algorithm with chosen sample data and recording values of variables in trace tables
trace tables
systematic method that documents values of variables at each step in a programs execution
breakpoints
stop point in code that tells debugger to pause execution
lets you inspect whats going on at that moment