Chapter 1 Flashcards
asasignment
giving a value to a variable on constant
variable
item of data that can be changed throughout the lifetime of a program
constant
item of data that cannot be changed throughout the lifetime of a program
What is a local variable?
a variable wthat’s scope is only within a certain subroutine
What are the benefits of subroutines?
code reuse, easier to design
What are the various types available in most languages?
integer, float, string, Boolean, list/array
what is the difference between a list and an array?
An array is fixed in size(static) and a list is dynamic
when would you use a while loop and when would you use a for loop?
while loop when you are not sure how long it will repeat (indefinite iteration) and a for loop is sued when you know how many (definite iteration)
what is 14%5
4
what is concatenation
the operation of merging 2 stings into one string
What is the difference between a procedure and a function
a procedure carries out a sequence on instructions and doesn’t return anything, where as a ffunction must return a valie
what is a parameter
data passed into a subroutine
there are two types of subroutine - what are they
function and procedure
A2: what is encapsultaion
the concept of putting properties and methods in one object
A2: what is a method
a routine within an object