2022 m/j 32 Flashcards
Explain why the properties have been set to PRIVATE
To ensure that attributes can only be accessed by the class’s own methods
To enforce encapsulation // ensure they are hidden
Identify protocols used by application layer. Describe the use of each protocol
(1)HTTP(S) for sending and receiving web pages / hypertext documents
(2) FTP for sending and receiving files over a network / between devices
(3) SMTP for sending/uploading emails /push protocol
(4) POP(3) for receiving/downloading emails /pull protocol (1)
IMAP for receiving/downloading emails /pull protocol (1)
Identify two other layers of the tcp/ip protocol suite
Transport handles packets
— Internet handles transmission of data using
IP addresses // provides (optimal) route
— Network Access (Interface) // (Data) Link // Physical, Handles how data is physically sent
Identify the three other categories of computer architecture besides SISD
— SIMD many/array processors execute the same instruction using different data sets
— MISD many processors (using different instructions) use the same data set
—MIMD many processors (using different instructions) using different data sets
State how a digital certificate is obtained
— enquiry made to Certificate Authority (CA)
— enquirer’s details checked by CA
— if enquirer details verified by CA then public key is agreed
—CA creates/issues certificate that includes the enquirers public key
— encrypting data sent to/by CA with the CA’s public/private key
Explain how a digital signature is produced before the message is sent
— The message is hashed with (the agreed hashing algorithm)…
— to produce a message digest
— The message digest is then encrypted with the sender’s private key to form the digital signature
Explain how the digital signature can be checked on receipt to ensure that the message has not been altered during transmission
— The message together with the digital signature is decrypted using the receiver’s private key
— The digital signature received is decrypted with the sender’s public key to recover the message digest sent
— The decrypted message received is hashed with the agreed hashing algorithm to reproduce the message digest
of the message received
— The two message digests are compared
— if they are the same the message has not been altered // if they are different the message has been altered
State a necessary condition for a binary search
The list to be searched must be ordered/sorted
Describe how to perform a binary search
— Find the middle item / index
— Check the value of middle item in the list to be searched
— If equal item searched for is found
— If this is not equal/greater/less than the item searched for
— discard the half of the list that does not contain the search item
—Repeat the above steps until the item searched for is found
— or there is only one item left in the list and it is not the item searched for // lower bound > / = upper bound
Explain how the performance of a binary search varies according to the number of values in the array
As the number of items in the list increases the time to search the list increases
Compare the performance of the algorithm for a binary search and linear search using big o notation for order of time complexity
—Linear search O(n) and Binary search O(log
2n) / O(Log n)
— time to search increases linearly in relation to the number of items in the list for a linear search and logarithmically
for a Binary search
— time to search increases less rapidly for a binary search and time to search increases more rapidly for a linear
search
State the reasons for including exception handling routines when writing a program, include an example of an exception in ur answer
To trap (some) runtime errors
To prevent a program halting unexpectedly
To produce meaningful error messages for these errors
Example divide by zero // end of file // file not found