computer science 13,14,15,16,17,18 Flashcards
describe the purpose of a user defined data type 2
- to create a new data type from existing data types
- to extend the flexibility of the programming language
explain how an interpreter executes a program without producing a complete translated version of it 4
- an interpreter examines the source code 1 line at a time
- and checks each statement for errors
- if no error is found, the statement is executed
- if an error is found, it’s reported and the interpreter haults
explain why the reverse polish notation (RPN) is used to carry out the evaluation of expressions 2
- RPN provides an unambiguous method of representing an expression
- reading from left to write
identify with reasons, a data structure that could be used to evaluate an expression in RPN 2
structure: stack
- the operands are popped from the stack in the reverse order to how they were pushed
give 2 benefits and 2 drawbacks of packet switching 4
benefit 1: accuracy - it ensures accurate delivery of the message
benefit 2: completeness: missing packets can be easily detected and a re-send request is sent so the message arrives complete
drawback 1: network problems may introduce errors in the packets
drawback 2: it requires complex protocols for delivery
explain he reason why binary numbers are stored in normalised form 3
- to store the maximum range of numbers in the minimum number of bits
- it enables very large numbers to be stored with accuracy
- it avoids the possibility of many numbers having multiple representations
compare sequential and serial methods of file organisation 4
- in both , records are stored one after the other and need to be accessed one after the other
- serial files are stored in chronological order
3.sequential files are stored with ordered records
- in serial, new records are added in the next available space
- in sequential, new records are inserted in the correct position
state the most suitable method of file access when a record is referenced by a unique address on a disk-type storage medium 1
direct acess
state the most suitable method of file access when a bank stores its data records in ascending order of account number 1
sequential access
explain how packet switching is used to transfer messages across the internet 5
- a large message is divided up into a group of smaller chunks of the same size called ‘packets’
- the packet has a header and payload
- the header contains a source IP address, destination IP address and sequence number
- each packet is dispatched independantly
- the packets may arrive out of order
outline the function of a router in packet switching 3
- the router examines the packet’s header
- a router has access to a routing table
- containing information about e-gateways
a record is a user-defined composite data type
explain what is meant by a user-defined composite data type and include an example of another user-defined composite data type 3
a composite data type refers to other/many types, user-defined data types created by the programmers to suit specific needs. an example, in python, you can create user-defined data types using classes
describe what is meant by RISC and CISC processors ( 2 points for each)
RISC- it uses simple instructions and fixed length instructions
CISC- it uses many instruction formats and uses variable length instructions
identify 2 differences between RISC and CISC processors 2
RISC has fewer instructions while CISC has more instructions
RISC has many registers while CISC has fewer registers
outline the functions of the Transport and Internet layers of the TCP/IP protocol suite 5
Transport layer:
- it regulates the network connections
- data is broken up into packets which are then sent to the internet layer
internet layer:
- it identifies the intended network and host
-it moves traffic across local segments
-encapsulates IP packets into frames for transmission
state what is meant by enumerated data type
a non-composite user-defined data type defined by a given list of all possible values