Chapter 1 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

asasignment

A

giving a value to a variable on constant

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

variable

A

item of data that can be changed throughout the lifetime of a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

constant

A

item of data that cannot be changed throughout the lifetime of a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a local variable?

A

a variable wthat’s scope is only within a certain subroutine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the benefits of subroutines?

A

code reuse, easier to design

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the various types available in most languages?

A

integer, float, string, Boolean, list/array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what is the difference between a list and an array?

A

An array is fixed in size(static) and a list is dynamic

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

when would you use a while loop and when would you use a for loop?

A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is 14%5

A

4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is concatenation

A

the operation of merging 2 stings into one string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between a procedure and a function

A

a procedure carries out a sequence on instructions and doesn’t return anything, where as a ffunction must return a valie

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

what is a parameter

A

data passed into a subroutine

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

there are two types of subroutine - what are they

A

function and procedure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

A2: what is encapsultaion

A

the concept of putting properties and methods in one object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

A2: what is a method

A

a routine within an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A2: What is a class

A

a blueprint that definies the properties and methods of similar objects

17
Q

A2: what is an object?

A

A specific instance of a class

18
Q

A2: what is inheritance?

A

using a class to share the porperties and methods wwith a subclass

19
Q

A2: what is polymorphism

A

havin the same method name with different arguments

20
Q

A2: what is overriding?

A

changing the implementation of a method in a subclass. This new method takes precedence over the method in the baseclass.