CS Exam Answers by Topic
CS Exam Answers by Topic
1.1.1Components of a Computer:
Describe 3 buses used to convey information between the special
registers (6):
- Control bus is used to send control signals from the control unit to
the other registers in the CPU. It is used to coordinate the FDE cycle.
- Data bus is used to transfer data from one location to another
- Address bus carries the location address where the data is going to
or from
Describe the use of special registers and their functions during the fetch-
decode-execute cycle, including jump instructions, reading from and
writing to memory (8):
1.2.1Systems Software:
Explain why the first come, first served scheduling method may not be
efficient (2):
- Once a job has started, other jobs cannot be processed
- Jobs that are slow or take a long time to finish, e.g. a printer, would
take up a lot of processor time
Sim + Diff:
- Both examples of partitioning memory
- Both allow programs to be stored non-contiguously in memory
(a benefit of both)
- In paging, memory is split up into equal sized divisions whereas in
segmentation, memory is split up into unequal divisions which
mimic the logical flow of a program
- In paging, the divisions are physical, whereas in segmentation, the
divisions are logical
1.2.2Applications Generation:
Describe what is meant by utility (2):
- Carries out a specific task
- To optimise and maintain a computer system
- (E.g. defragmenter or virus checker)
Explain the need for intermediate code and its purpose in a virtual
machine (8):
Intermediate code:
Is simplified code that…
…is between high level & machine code
…is produced by compiler
…runs on any computer
…allows portability between machines
Allows sections of code to be written in different languages…
…by different programmers
…suitable for specific tasks
Error free
Virtual machine:
A theoretical computer which provides…
…an environment in which a translator is available
Uses an interpreter to run the intermediate code
Points in the context:
A translator is used to convert code from one language to another…
…from source code to object code
Mention of types of translator: compilers, interpreters, assemblers
Dynamic (1):
- Size of data structure can change during processing
- Disadvantage: harder to implement as storage required is unknown
initially
State the difference between a foreign key and a primary key (2):
- A primary key will only appear once in a table as it is a unique
identifier
- A foreign key may appear multiple times in a table as they refer to
other tables
1.3.3 Networks:
Describe what is meant by a LAN (2):
- A LAN is a Local Area Network
- that covers a small geographical area
Layers:
Explain how the DNS plays a role in websites being loaded (4):
check mohit’s notes for more – these/below are to be completed after
mock)
1.3.4 Web Technologies:
Describe what is meant by the term JavaScript (2):
- JavaScript is a scripting language that is used within HTML to add
interactivity to a web page
- A programming language that runs in a web browser
- that can be embedded into HTML
- with <script> tag
- to add interactivity to a web page
Explain why it is usually the case that JavaScript is interpreted rather than
compiled (2):
- It is usually interpreted because it needs to be run on multiple
different computer architectures rather than a single type, and if
you compile it it can only run on one type of device, but it needs to
be accessed by many other devices of different types
- JavaScript is likely to be run on a variety of machines
- with different architectures
- Compiled code is machine dependent
- whereas interpreters run on high level code
- which is machine independent
Describe how black box testing can be used to test a program (3):
- Tests the expected output
- based on input
- Does not look at the code / only looks at program specification
Choose one search algorithm and describe how this algorithm works (5):
Binary Search:
- Works on an ordered set of data
- Find mid-point
- If equal to midpoint, report found
- If less than midpoint, move lower bound 1 higher than the midpoint
- If greater than mid-point, move upper bound 1 less than the
midpoint
- Repeat doing this until the value is found / sub-list is empty
Linear:
- Can work on both and unordered
- Get first element
- If equal report found
- If not equal move to the next element
- Repeat for all the elements until the value is found / end of list
reached
Explain why characterx and charactery are passed byRef and not byVal
(3):
- ByRef changes the value in the variable passed
- ByRef passes the address/location
- ByVal only a copy of the data is passed
- (ByVal the change would be lost when the procedure ended)
Give two reasons why Eve should use abstraction when designing the
game (2):
- Reduce programming time/cost
- Program requires less memory
- (Simpler to solve the problem)
- (Reduces complexity of programming code)