computing Flashcards
what is abstraction
process of removing unnecessary detail from a problem
what is decomposition
problem broken into sub problems
binary vs linear search advantages
linear search is less efficient with large data sets
linear search is slow
indefinite iteration
REPEAT
instructions
UNTIL Solved
nested iteration example
WHILE NotSolved
instructions
FOR i <- i TO 5
ENDFOR
ENDWHILE
what is mod
the remainder
what is integer division
integer with no decimal
records example
RECORD Car
make: String
model: String
reg: String
price: Real
noOfDoors: Integer
ENDRECORD
in python
from dataclasses import dataclass
@dataclass
class Party:
name: str
mps: int
colour: str
how to import a random number
random.random()
pseucodoe to authenticate user
REPEAT
username <- USERINPUT
password <- userinput
UNTIL ((username = ‘gower’ AND password = ‘abc’)
OR
(username = “lalala” AND password = 888”))
what is sound
an analogue, it must be converted to a digital form for storage and processing in a computer
what is a sample
a measure of amplitude at a point in time
what is sampling rate and resolution
rate:
number of samples taken in a second, measured in hertz
resolution; number of bits per sample
high level language
allows for programmers to write in a language that is easier to understand than low level language
what is an interpreter
directly executes instructions without converting it into machine code