Com sci last minute bits to remember

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

21 Terms

1
New cards

what is an advantage of local variables

Modules are self contained and can be reused in other programs without needing to take the global variables with them

can keep track of variables better because global variables can be changed anywhere

memory efficient since memory releases them when the module is over whereas global variables are held in memory the entire program

<p>Modules are self contained and can be reused in other programs without needing to take the global variables with them <br><br>can keep track of variables better because global variables can be changed anywhere <br><br>memory efficient since memory releases them when the module is over whereas global variables are held in memory the entire program</p>
2
New cards

Passing by value

when a parameter is passed into a function by value a copy of the original data is created and stored in a memory address separate to the original data. When the variable is modified it is this copy in memory which is modified and not the original data

3
New cards

Passing by reference

When a parameter is passed by reference into a function a pointer is stored in memory which points to the memory address of the original data. When the parameter is modified the original data is modified

4
New cards

-VE LOCAL variables

more difficult to trace/follow/debug where the values are passed

5
New cards

+ve Global variables

easier programing simpler to follow

6
New cards

-ve Global

Memory inefficient not a good programming techinique

7
New cards

3 situations where the linear search is more suitable than the binary search

there is a small number of items
IF THE DATA IS NOT SORTED
IF THE ITEM YOU'RE LOOKING FOR IS THE FIRST ITEM IN THE LIST.

8
New cards

some musts for get methods

they are FUNCTIONS because they return a value to the section of the program which called it
Public Function get_name():

they do not take a parameter

9
New cards

some musts for set methods

They are PROCEDURES because they do not return a value. Public procedure set_name(name):

They take a parameter because how can you set when there is no value passed into the procedure

public procedure set_name(name):
name1 = name

10
New cards

A charity has several desktop computers in their office that use a CISC processor. They are considering buying mobile devices for their staff to use when they are not in the office.

Discuss whether these mobile devices should use the same CISC processors that are used in their desktop computers or if they should use a RISC processor instead
You should include
- the difference between each processor type
the suitability of each processor type for mobile devices

- The problem was that I dumped all of my knowledge into the question but didn't link to the context enough.
AO1
CISC is a complex instruction set. The traditional approach to processor design. LOTS OF INSTURCTIONS ARE AVAILABLE ALTHOUGH SOME INSTRUCTIONS IN CISC WILL RARELY GET USED. RISC is a reduced instruction set. A smaller number of instructions available, several instructions can be combined to perform the same tasks as CISC processors. RISC instructions are used regularly.
RISC has fewer transistors/less complex circuitry whereas CISC integrated circuits are more expensive/complicated.

11
New cards

Define encapsulation.

WHEN AN ATTRIBUTE IS MADE PRIVATE SO THAT IT CAN'T BE DIRECTLY ACCESSED OR CHANGED FROM OUTSIDE THE CLASS
PUBLIC METHODS ARE USED TO READ/AMEND THE ATTRIBUTE'S VALUE

12
New cards

Define inheritance

WHEN A CLASS HAS THE ATTRIBUTES AND METHODS OF ITS PARENT CLASS
IT MAY ALSO HAVE ATTRIBUTES AND METHODS OF IT'S OWN

13
New cards

Define attribute

Value held by object

14
New cards

define method

action an object performs

15
New cards

Describe how a quicksort would sort data into ascending order

- Choose a pivot & identify start and end pointers
- Compare each element to the pivot compare the start and end pointers
- Put items < pivot in the left sublist
- Put items > pivot in the right sublist
- Choose a pivot in each sublist
- Repeat this until each sublist contains one item and each item is a pivot.

16
New cards

What are the stages of the waterfall lifecycle

FRAD ITI DEM
Feasibility study
Requirements - identify requirements
Analysis
Design

Implementation/coding
Testing
Installation

Documentation
Evaluation
Maintenance

17
New cards

what type of projects does the waterfall suit

Tends to suit large scale projects tends to suit project with stable requirements

e.g an OS and the base requirement of an OS is unlikely to change

18
New cards

disadvantages of the waterfall lifecycle

IF A CHANGE IN THE REQUIREMENTS DOES OCCUR THE LIFECYCLE CANNOT RESPOND EASILY, OFTEN AT THE COST OF TIME AND MONEY

19
New cards

Describe the RAD process

PROTOTYPE IS CREATED
IT IS EVALUTATED AND FEEDBACK IS USED TO INFORM THE NEXT ITERATION
ANY CHANGES ARE MADE
PROCESS IS REPEATED UNTIL
THE PROTYPE IS CRETED

20
New cards

List the features of an IDE

- Text editor:window that allows you to write code
- Autocomplete tries to predict future actions you might want to complete when writing code help you avoid mistakes
- Automatic formatting Automatically formats your code to match the requirements of the language E.g. Idle automatically indents when you begin iteration
- Keyword highlighting/colour coding The colours automatically applied to your code as your write different colours are applied to different elements of your code to support its readability and help you spot errors and debug don't impact how your code is executed.
- Automatic line numbering Useful for debugging error messages will quote the line number where the error has occurred
- Syntax checking Will underline syntax errors as soon as you make them. Saves time as you don't have to look for the errors.
- Runtime environment A feature which translates your code allowing you to run it.
- Debugging tools Makes it easier to find logic errors e.g. Break points(logic errors don't prevent your program from running)
- Version control A feature that will record changes made to the program file over time. If a mistake is made you can compare earlier versions of the code to help fix it.

21
New cards

Describe 4 advantages of splitting a problem into sub-procedures

1 mark per bullet, max 2 per advantage to max 4 e.g.
· Procedures can be re-used · No need to reprogram/saves time

· Program can be split between programmers · Can specialise in their area

· Speed up completion time · As multiple procedures worked on concurrently

· Easy to test/debug · As each module can be tested on its own then combined.