YEAR 1 CO2 WEEK 5 + 6 ARRAYS STRING MANIPULATION FUNCTIONS PROCEDURES Flashcards
Define an array.
A collection variable or data structure which stores a collection of data items of the same data type under one identifier.
What are the different commands you can do with an array.
Array.length
Array.indexof();
Array.sort();
Array.resize
String Manipulation
String datatype is a collection of characters.
String strname = “RAD”
Char x = strname[4];
strname.length
Strname.toupper()
Strname.tolower()
State differences between function and procedure.
Both are named sections of code that take in parameters and perform a task.
Procedures do not return a value.
Functions return value to variable at location where function was called.
State difference between parameter and argument.
Parameters what are used inside subroutine and arguments the values passed into subroutine when called.
Difference between passing by value and passing by reference.
Passing a parameter by value a copy of data is used in subroutine and discarded when subroutine complete.
By reference memory address of data is used by subroutine. Any changes made to the data when subroutine executes is kept.