EXAM Flashcards
What do you have to do when you store something in LMC
You have to store it into a memory address with an integer value between 1 and 99
FIVE DAT 5 or 5 DAT FIVE
FIVE DAT 5
What should you do when branching in LMC
Put your first instruction on the same line as the line for example POSITIVE LDA X all needs to be on the same line
How do you declare a 1d array pseudocode(first way)?
array names[3]
names[0] = “Ahmad”
names[1] = “Ben”
names[2] = “Catherine
How do you declare a 1d array pseudocode(second way)?
array names[3] = [“Ahmad”, “Ben”, “Catherine”]
First way to declare 2d array
array scores[2][2]
scores[0][0] = 14
scores[0][1] = 80
scores[1][0] = 20
Scores[1][1] = 82
Second way to declare 2d array
array scores[2][2] = [[14, 80],[20, 82]]
How many elements would be in the array chores[3][3]
9
How to delete whole rows from sql
Do not use a where clause so all values will be deleted
How to delete specific rows from sql
Use where clause to specify conditions that need to be met
Can you delete specific columns from sql
No
What do you need to remember
How many bits to use
Two’s comp
First bit is negative if it is 1
Sign and mag
First bit just determines wether it is pos or negative
Subtracting values tc
Convert the right one to other sign
Adding negatives values
Do it normally
When talking about what a queery does, what do you say
From “whatever the table is called” and then put what it returns
How do you select multiple atributes in SQL
Put a comma between them
How do you delete a table
DROP TABLE Students
How do you delete a database
DROP DATABASE GuestHouse
Can you do OR in SQL
Yes
Can you do AND in SQL
Yes
How to do like
WHERE City LIKE “Ber%”, this means it stars with Ber, if it was before it would end in Ber and if it was on either side it would contain Ber
In the select clause, what do you do when there is two tables
Customers.FirstName, Orders.OrderDate
What do you put in the WHERE clause when you are joining tables (inner)
WHERE Customers.CustomerID = Orders.CustomerID
How do you do a nested select
What is normalisation?
The process of structuring the data in a relational database according to formal rules, in order to avoid problems of data redundancy which leads to inconsistency and inaccuracy.
What is the aim of normalisation?
The aim of normalisation is to minimize data redundancy and maximise data integrity
What do you do for first normal form?
Each record (row) is unique
i.e. it has a primary key
Each field (column) has an unique name
There are no fields with repeated or similar data
e.g. choice1, choice2, choice3…
Each field cannot be broken down any further
e.g. addresses should be broken up
What does first normal form do?
Makes all the data atomic
What does atomic mean?
Atomic means each item of data is distinct and you can’t separate the data any more or break it up any smaller without losing meaning.
What does second normal form do?
Non-key fields must depend on every part of the primary key
In other words, if a field that isn’t the primary key depends on only one part of the primary key (i.e. a partial key dependency) then it isn’t in second normal form.
When would you not need to do anything for second normal form?
If you don’t have any composite primary keys
Passing a parameter by value
A copy of the variable is passed where it is treated as a local variable to project the value being changed
Passing a parameter by reference
The reference to the memory location is passed so the value can be changed
What can’t be passed by reference?
Literal values as there is no reference
What will happen if ref or val is not stated
It will be passed by value
What is bad about value
It uses additional memory space
What is abstraction?
Removing unnecessary details from a problem to focus on the details are are needed which makes the problem easier to solve
Example of abstraction
Underground tube maps as they leave out above ground landmarks and roads as that is not relevant to travelling on the tube
Why would a man who works in an office use a usb
To transfer data between his home and work computer
Man in office Hard drive
Used to store data on work computer as generally companies would use hard drives as they are cheaper especially because multiple devices have to be provided
Man in office ssd
For home computer
What are two of the gaps you need to fill in the gap fill exercise
13 and position
Why does passing something be reference require less storage
Because A copy does not have to be made
What is another advantage of passing by value
Value is good as if there is a logical error it wont affect code
Why would passing my reference be used here
there wasnt a point where you could accidentally override the player so no need to pass by value to use less storage
Another advantage of abstraction
Requires less computing power as details are removed
Example 1 of abstraction furniture
Only one room will be customisable at a time so the computer does not have to render the other rooms
Example 2 of abstraction furniture
Textures for carpet/floor and cieling dont have to be loaded
first two positives of waterfall model
Lots of documentation, does not require a lot of customer involvement
Second two positives of waterfall model
Easy to schedule and arrange tasks and judge progress, Simple and easy to understand model
First two negatives of waterfall model
Lots of documentation, efficient code is not prioritized
Second two negatives of waterfall model?
No new ideas can be included during development, Users not involved until testing
When might waterfall model be used?
Straight forward projects where requirements are known and understood at the beginning and do not change, When there is no benefit to the customer of having parts of the system available early and Short projects
What is the waterfall model?
A linear, sequence of stages. Each stage is completed before the next stage begins. Good for small, simple projects where requirements are clear and do not change.
first normal form
Each row is unique, data is atomic and no fields taht represent a group of data
What does it mean if data is atomic
Atomic means each item of data is distinct and you can’t separate the data any more or break it up any smaller without losing meaning.
Second normal form?
Data is in first normal form
Non-key fields must depend on every part of the primary key (no partial dependencies)
Why wasn’t it in thirds normal form?
3nf as destination name relies on destination code which isnt the primary key
What are the three stages of an LOR?
Knowledge and Understanding, Application, Evaluation