SDD Unit Flashcards
What is a procedure?
Subprograms are often called procedures ( Which execute a set of commands). They break down the program to make your code modular, readable and therefore more maintainable. It is a subprogram which can be called from within its main program. They do not return values
What is a function?
A function is a subroutine/program which returns a value. In case of object-orientated programming languages (Such as Java) it is called ‘method’.
What is a compiler?
A compiler is a special program that processes statements written in a particular programming language and turns them into machine language or “code” that a computer’s processor uses.
What is an interpreter?
An interpreter translates the program a line at a time into binary as the program is running.
What is stored in RAM?
Temporary data that is being used by any active application or active process on your computer, otherwise known as ‘Volatile memory’. If the computer is turned off, all volatile memory is lost.
Why would a programmer use a function?
- They allow us to conceive of our program as a bunch of sub-steps. (Each sub-step can be its own function. When any program seems too hard, just break the overall program into sub-steps!) 2. They allow us to reuse code instead of rewriting it. 3. Functions allow us to keep our variable namespace clean (local variables only “live” as long as the function does). In other words, function_1 can use a variable called i, and function_2 can also use a variable called i and there is no confusion. Each variable i only exists when the computer is executing the given function. 4. Functions allow us to test small parts of our program in isolation from the rest.
What is a translator?
A translator is a computer program which is designed to convert coding language - also known as high level languages - the computer cannot understand into a language the computer can understand without damaging the structure of the code.
What is a parameter?
A parameter is a special type of variable of arrays which can be used to set the range of numbers within a program. A parameter can be used within two different situations which are passing parameter by reference and are passing parameter by value.
What is passing a parameter by reference?
Parameter by reference is when the variable or array is passed into the sub-routine and changed, which means any changes there are to the formal parameter occuer to the actual parameter.
What is passing a parameter by value?
This is when the variable/array is passed into the sub-routine and not changed; meaning the variable is temporarily stored whilst the sub-program is running and discarded once finished executing.
What is input validation?
Input validation is a standard algorithim that involves avoiding input errors by repeatedly asking for data to be entered until it is an acceptable value.
What is a linear search?
A linear search is a standard algorithim that involves searching for a value at the first item in a list and it will continue searching through each item of the list in turn.
What is counting occurences?
Counting occurences is a standard algorithim that involves counting how often a value occurs in a list of items by setting a counter to zero, searching the list for the occurence of a search value and incrementing the counter by 1 each time the search value is found.
What is finding maximum?
Finding maximum is a standard algorithim that involves finding the maximum value in a list by putting the max variable to the first item in the list. Each item in the list is compared to the maximum value to see if it is biggerand every time the item in the list is bigger than the maximum value, the maximum value will be upgraded to that item.
What is finding the minimum?
Finding the minimum is a standard algorithim identical to the find maximum algorithim except each item in the list will be compared to minimum value to see if it is being smaller.