Revision – part one
Starter – keywords...
Revision list Data Representation Units of data
Lets start with the basics… Bits in a byte = Historically: Why do we measure things as a byte? Name of this system? Why did the system have to change? What’s a better system?
Lets start with the basics… Bits in a byte = Number of bits in a 10 megabyte = Number megabytes in 2 gigabytes = Number of megabytes in 2 terabytes = (Most importantly – how do you work it out?)
Lets start with the basics… How would you measure: a)A full length HD movie b)ASCII characters c)Mp3 music file d)Typical hard disk in a modern laptop (Most importantly – how do you work it out?)
Quick one… Going from analogue to digital is…
Lets start with the basics…images A picture is made of … The number of these affect the … This is the amount of … in a …. Each of these … has an amount of space allocated to it. This is the … The size of the … affects the amount of … the pixel can hold An image with a 2 bit … can have … colours An image with an 8 bit … can have … colours
Lets start with the basics…sound A sound is made of … The number of these affect the … Its measured in … This is the amount of … in a …. Each of these … has an amount of space allocated to it. This is the … The size of the … affects the amount of … the …
Work out… Work out file size: ((height x resolution) x (width x resolution)) x colour depth 3 inch by 4 inch image 300 pixels per inch (ppi) 8 bit colour depth
So… What affects the size of an image file
Add these bad boys…
Data types…
Error handling Three main types of error when programming errorWhat causes it
3 debugging tools
For a … error, you might use a …
Example 1 nextnumber1number2number3 for next in range(1,10,2): number1 = next number2 = next * next number3 = next / 2 Are you happy with this function?
Example 1 nextnumber1number2number for next in range(1,10,2): number1 = next number2 = next * next number3 = next / 2
Example 2 A = 3 B = 3 For C = 1 to 4 B = B*C A = A+C Next C CAB
Example 2 (Psueudocode) A = 3 B = 3 For C = 1 to 4 B = B*C A = A+C Next C CAB
Example 3 Variable LineABComment Pseudocode A=4 B=7 1Input A 2Input B 3If A=B Then 4 B = 2 5Else 6 While B>A 7 B=B-A 8 End While 9 A = B End IF
Example 3 Variable LineABComment False: goto True: continue Pseudocode A=4 B=7 1Input A 2Input B 3If A=B Then 4 B = 2 5Else 6 While B>A 7 B=B-A 8 End While 9 A = B End IF
Bugs can be hard to find...