100%(1)100% found this document useful (1 vote) 2K views31 pagesComputer Science-0478
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
SRI SANAKARA GLOBAL ACADEMY, PAMMAL
COMPUTER SCIENCE- 0478
WORKSHEET- CH-1 AND CH-7 +
1 What is the largest denary number that can be created with a 4-bit binary
number? \S
2 Convert the denary number 6 to a 4-bit binary number. 9 \\ 0
3 Convert the binary number 9 to a 4-bit binary number, (0.01
4 Convert the denary number 58 to an 8-bit binary number. Coy) 1olo
Convert the denary number 123 to an 8-bit binary number, 911) 1 of )
ow
& — What is the largest denary number that can be created with an 8-bit
i binary number? Q5 5
¢
convert the 8-bit binary number 0110001] toadenary number, 4.4
8 — Younced to be able to convert up to 16-bit binary values. Fill in the missing
units in the table and calculate the denary number for the given binary number.
basal t3sufe\an [oa] aoe] toa] 12]256|128]64 [32 [16 Je [4 |2 ]1
fo i 1 Oo 0 0 1 Oo 1 Oo jO0 |0O 1 Oo |0 1
7 ASQaS
9.
Convert the hexadecimal A2 toa binary number. |olooolO
Convert the binary number 100111010001 to hexadecimal. 4p}
Convert the denary number 350 to hexadecimal. 15 €
Convert the hexadecimal 3AC to a denary number. 40
10. us
01 000011
Add the 8-bit binary values. boot and 01000011.
Add the 8-bit binary values C TOOT 03 and 01010111.
Seto Tt
Ito
OWEis
; \ 6
Describe what happens in a logical binary shift.-Shigte the bio” vee rs,
; e
Perfor ica i ri: i r 0) 100,
Perform two logical shifts to the right on the binary onberd 110)10 7
Oowioi ah
ro behead aH
. x
a,
a. 2%, 6A
bw
‘A camera detector has an array of 4096 by 2048 pixels and uses a colour depth of 16. 3 %
Calculate the size of an image taken by this camera; give your answer in MiB. arth
v
54
(
ho%b x 20ue xe). (gx ory Xtoru) = 1bMiBb.
An audio CD uses 40960 samples per second, with 16 bits being used per sample.
The music being sampled uses two channels to allow for stereo recordings.
Calculate the file size for a 1024 second recording. Give your answer in MiB.
= (toate x tb x12) bile
5 hodbe XIb X 1024 «al ko Sterorec)
Exwr-y xX lo2y = leomMiB13.
a Give three reasons why it is often necessary to reduce the size of a file.
1 GANA Aereye ean Upp... sor...
FM FER sen tn...Akeanek..
Raduction....ie. Ab ae, AO EDS RAL ee
b Explain the difference between lossy and lossless file compression.
sb. Les
AL..cleda..dena00. Re.
On ga nN CAA lt “
Asconi bic d te. dt}. Original nana be..rvsonshucld bad
Heda. untannbsexsed 4a
© i. Give one example of the use of lossy file compression
o apes 3-~ ve enpes, of 1} pag
ii Give one example of the use of lossless file compression.
se RAE sa14.
‘a Which one of the following is not a correct hexadecimal number?
‘A CODE
B AXIS
© 1DEA
D FACE
b The number of bits used to represent a sound sample is known as:
A the sampling rate
B amplitude value
© loudness of a sound sample
D sampling resolution
€ The MP3 format removes redundant sound from a file. Which one of the following best describes
the type of file reduction being used by the MP3 format?
A lossy files compression
B sound file damping
© image file compression
D losstess file compression
Temporary files produced by a camera where no compression has been applied, are called:
A jpeg files
B png files
C Gif files
D raw bitmap files
—____.
© Lossless file compression, which reduces the size of a string of adjacent, identical data, is
called:
A jpeg
B run-length encoding
———
© sampling resolution
D audio compression15.
Explain what is meant by run-length encoding (RLE).
wT SSA nto nehA 00,
2, ee Hat.. a tym ag % ase
idsalacal. vn
a peaked “ay “is taseded._in 2 vols,
fet: vale PtP byorddanbieal. cake ‘tems
ce Mead eo Don lAhQ, oF daka.item .
i The above monochrome image is being designed.
Each white square is represented by 'W' and each dark square is represented by ‘0’
Show how run-length encoding (RLE) would be used to produce a condensed file
for the above image. Using the grid below, write down the data you would expect
to find in the RLE compressed format; the first two have been done for you.
w | | S| HDI sud LD | Iw [ap |i
IWi ot. {LD iw (> iW lop
3W 4D SW 2D > law |ii Assuming that each square in the 8 x 8 grid requires one byte of storage, and each
character in the RLE code also requires one byte of storage (for example, '3' requires
1 byte, 'W' requires 1 byte), calculate the file size reduction when using RLE.
16.
‘a. Explain the following terms used in the electronic storage of sound:
ii sampling rate
Knee 2, goed. babes Glo, (sec.
Look at the sound wave below that has been sampled:
Pesbe sown
Sample somber
PINTS e189
i From the graph, what is the sampling resolution?
soul BI\
\.
li From the graph, what is the sampling rate?
lez... C10, Saenfles. Se.)
iil Using the x-axis, locate points 9 and 18 on the graph. Wirite down the 4-bit binary
values corresponding to the y-axis values of these two points.
oar [IW wie | —
poi 18 u_|_teu
Discuss the benefits and drawbacks of increasing the sampling rate and sampling
resolution when representing sound in an electrante (binary) format.
Kol eeee.en. EAA CaO
Pla,
bol Oa... | rast abt Sound. pak
fan 4 yuaaes s ve a
ge
Lear aay. 1...
3. TAR... degen. “tre Loree [dessotocd..ousse piles
sonal Meguliee. great Prowesing paws.
17.
Write down a series of steps that could be used to convert a denary number into a
hexadecimal number. Your steps should allow somebody to fallow them clearly to give
fect converted valve
cal cn The BOE MADE lB
* wad, beech... Xeon aud és Urorinp Bach aadsion -
Pn bth ARAN ELENA, need 00..be toon te kop.
* ABO ALM CORN EAE on ALARA LEE lA. Lote HO Wek
OWA cB BI Got DE no Bod .
ot BAB. AO,
3D. AY.18.
a State what is meant by a bit.
bina bk
b Give two reasons why computers use binary numbers rather than decimal numbers.
1 nN th. fn BAN hl Susitclats. been sors -
bh C40 le QML), R
Explain why the hexadecimal number system is used by computer technicians and programmers.
Bede care ee Iucourm feed Att a. bin veluw.
ee digits. Hn Abr 9.66 Cob BOB bie
Pein APLC Senn nn
Esau. the... HORACE WAL. bebe bt urd at Raton
i sob le, onibing.. PIO ttn eO6 af nfBAdors | ashe.19.
Use the following list of words and phrases to complete the paragraph below.
Each word or phrase can be used once, more than once or not at all, o
» breakdown @) »» description » hierarchical ()) »_top-dow
» bottom-up » diagrammatic) » Eel @) » “Structure diagram
» composition » Flowchart » progam €D) » system_)
» decomposition » formal » "pseudocode » sub-systems
0
Structure diagrams are used to show the .. design of a computer ©
in nant
A structure diagram shows the design of a computer program in a...
with each .. ©.
. form.
... giving a more detailed
into ..
20.
a Draw and describe the use of four flowchart symbols. Any tour
1 wa 3.
Cc a |
Lorochert
Teaminator 5 Sy Goods
wed ak eee ord “bmp ale
2),..cthe,.ftoee Chere.
Rroceas kLowdhnaak . Decision Poocrut oe
Shows acho decide which adi bo be
Laban ren -
wae d lee Sebi ,
cen ;b Describe the purpose of flow lines ina flowchart. (uta Ofdws to Show the
ai
Describe the function of each of the following types of pseudocode statement and give an example
in pseudocode of the use of each one.
Aesignment
The.Single.vetiebie. onthe Anka Dpacthe <— As
artentpotch hada dete fy HB PEER on Ee vighk
He lotr... $—.beawnde +2 so
Conditional:
bihen diff.._.4ckdans, OMe. Apoaharonad, by an
PARA ALCP NE ACO M eB Bln Vervialrtes
at BNA O A nO nsonOr Onan SintbQrthnue® Bac de
WR h oon abhi we be erfenredhatnnnn
a: Ee BBL 2.20.
THEN aes
OotpuT SS ENG be
1S Nott e\eele”
Tterative:
PS 0.0. DndOEe Apsagerorad Atk
\ecrabionss....atakemark could be
gee FoR a & 1705
ourpot 8 al Key t ae22.
There are three different types of loop structure in pseudocode.
For each one, describe the structure and write the pseudocode statements needed
to output the names of 20 students that have been stored in the array
Student [0:19]. Use the variable Count:
r for the iteration,
L00P cna EOReontatatintlQ,, NEXT. esas
FDR COCA on Soa Pon TOL Vossen
soo ATEP RT... Stodent Peourtin on
LNEXT....... Ceunkin,
LOOP 2 enn EPEAT. 00 2 UNTIL
ON ONT eo SB.
REPEAT... son
QNTPOT.ngowdank. Vdaxntin
lbh es Fr ven OLE LK, LL
cred NT abe GME Een BalLoop 3:
ENDWHILE
“WHILE COLCA Ge Bir HP oo DO
purport... .Geudent Cooankea J.
COUR. Som oabe OCA. tN
END. YELLE,
b i There are two different types of conditional statements used in pseudocode.
For each one, write the pseudocode statements needed to output a different welcome
message for each name input from,Alice’, ‘Abid’ ‘Dinesh’, ‘Daisy’ or ‘Zak’ or a rejection
massage. Use the variable Name for the input. =
Conditional Statements 1: mene LOE conan ERE IONL ooke,
OUT ROT oe PARE ou QO YOM IN.
PIT INA
TR. Nent..3. Alco
oT HEN. :
ourper..” et come. ru
Te..Naot...5.. Abd
THEN.
“OUtPUT...\ bledusome...Abid.”
ENDIFConditional Statements 2 wm CASE... Staktontnk...
" Pleadé.....ombta... ye a
Dat
CASE. SOF sul MAb -
Neb a OUTPUT... Helena, Ata!
8 A bla Ma Abid
Dinoab.
4
OTRERWISE... OPTRUT...“.. Yu, artnet welcome
END.CASE.....
ii State, with reasons, which conditional statement is more appropriate to use in this case.
— CPSE SNR pont ees sea te Awad &There are two different ways of writing a flowchart to output the names of twenty students
that have been stored in the array Student [0:19]. The loop counter Counter is tested at
the start of the loop (pre-condition) or at the end of the loop (post-condition).
i Draw flowcharts for the pre-condition, loop and the post-condition loop,
Pre-condition loop:ji Identify which pseudocode loop statements matches each flowchart.
HME do ond oe
When you have learnt how to write programs that include loops, write three programs to test
that your answers to part a work as intended.
Hint: for Python there will only be two programs.
100 1 sn E PB Qa Slat AVERT,
Skudent....|ANw", Jen"
Counkeh..2..0. ae
iO ee. Ne, Kenge. Cae d.tn.
pink. Student Lecunls 1.)
conten LY,
aLoop 2: bt
LOW ON,..8.
wabile.. ae $. eae eae
pant.(skudeak. Ceaunken d. =
Lop 3: GREE Bh Eo AEA. EN
“nok awl. for pytton -
23.
‘a. Write an aigorithm in pseudocode to input ten numbers and output the total
DECLARE. MAO y wort OE nda NTE CHER,
DECLARE Counker..! ENTE ER.
rk SO.
a a bas
DUT PUT on EE MER tH MB, owendetn! -
SEN.PUT...AMEN.. :
tek <— bob trem
NEXT counker
total da.”
OUTPLT.b Write an algorithm using a flowchart to input ten numers and ourput the
v
“oval ee
unk £0
[Total E-Ten + em
eo
Counta stounta 1
NO Coke
a,
(i
She"24.
Look at this algorithm, shown as a flowchart:
J2 Identify the processes in the algoritn
ae fuesses alleredd
HR = & ques pe a word
lout a lathe cay Ae gatas 3S cortede
Quel. Uudee how mery guctsaa oot LE
lp = 84. fe, how te dees As cored or rab
1
b Describe the purpose ofthe algoritim,
a “gen
Alken he. wo te deide boo “I re
c Rewrite the algorithn: in pseudocede.
ovipor “Hell done you qua
DEcLARE ON’ INTEMER is
: ta ee THR
DECLARE G . STRING ae
\ ELSE
DeeLARe Finsh: BetEAM | oS You dulled, hyaye
Finish, & FALSE N&nel
“ a vol ENDLE
NL Finish pTrue 08 N=O
qupot WV
Repeat 7
purr “Pleme enke your pA
anput
ce Wen
Then25.
Use the following list of words and phrases to complete the paragraph below.
Each word or as can be used once, more than once or not at all.
>> maximum
» algorithms
» averag:
> bubble
» counte
> countin
> n@®
» list
Standard methods of solution are used in the design of
. These include
adding in a new value every time an action occurs, for example, awarding a mark to each
student - this is called : soune When divided by the number of times this
occurs, this qives the Keeping a record of te nuniber of times an
action O€cuts is Called nem Finding the largest. :
and smallest, «, are also standard methods.
In afder to look for an item in a list a
is used. The method you need to
knows for IGCSE Computer Science fs to inspect each item in the .... sooo I tee tO
see if t ig the one required. This is called a
To put a list in order a is used. The method you need to knox for IGCSE
Computer Science is called a26.
Explain the operation of a bubble sort
% fede elumedt too dist 2e amped with
tro nek element and seeped Wo the elements
oi nthe tomony dens
% Stealing fren the fist clement and Finis hing eotth
He newe tO. Last Clamed »
a bubble sort algorithm in pseudorode to sort a(faYoF ten names, in a
- in ascentirg vider.
seb AK on SND
REPEAT.
$24 OR. FALSE
FOR... Ender. Konkel, 1O., hawk
Tr NemealTnder...2 Nore [Tndew.s:)}
TREN 1) '
Lou Tetcen Naenes Binder
Nanos [Inder J. Narnes[Tadex +]
Namo. [inden 1.4 Teen
Book < TRIE
End ir
NEXT Inden
Lage < Lage -1
Unt Soah oc bue OR Last 127.
!Va‘idation and verification checks are used on values that are input into a computer program,
a I State when it is appropriate to use validation.
veidakian.....eheckr.only... eesenadire eke.t0 ovcepted
ohn Aska as enkrrod.
ii State when it is appropriate to use verification.
Veapicken. Dek. Onstk... thake tha.deken..dpesrole Ehanpt
Oe A being....eakered...
b i Give two examples of validation checks.
1 EEG ban A Be Chewols.
2
ii Give two examples of verification checks.
1 dude. enbiey
en Ce ee28.
1a. Explain the purpose of test data.
Tes deka. is QoS batty Maldes. tel, bo
hack... usher... Sluiton...20..serbeg. oe ite shoud 5
FE TR NAN Otte A080. ER kB a
b i Boundary data is one type of test data, Identify and describe three otiver tyoes of
test data
1 Ocaned,..cleda.. Carteck....... seb. a doko
2 nemarrerad nu ak @ “doko. “that must be
Age cad
Bi PHANG Abe =. tho. daagese.end
SromUutat... Maas. tak.noronad cake.can tale,
fi. Give the set of boundary data needed to cneck tiat a whole nusnber is less than 100.
Fn Aon NE tHe Laownd nay.
2 vrnnenn lh OQ Wk? dite. He bonwadacy -29.
‘a Use the trace table and the test data 78, 34, 22, ~4, 98, 16, 734, 88, 999 to record a
dry -un of this algorithm written in pseudocode,b State the purpose of the algorithm,
hte Pe ede OAD. MAM Ata dP... bla 0% 100-
4 tha bobed.op. thse, Vabid fp vabuse
ole. the. a2t.u.man...and.tht botad
© Rewrite the algorithm as a flowchart.
Sh OnKd_Use the guidance in Chapter 8 to rewrite this algorithm in pseudocode, ensuring that:
» there are meaningful prompts and outputs
>» the algorithm could be read and understood by someone else.
No.ofmanks, 4-0,
Highmaak..$22....
Loemank..<.129
i
Reece ar.
ounpu.n.. entia....984... 49... Finig be ;
OUTPUT. MAK. 4i bBo the wang Q-100, nba the
renk number?
INPUT Mak a
TE MAA SS 954
THEN
REPEAT.
IF Mak £0 OR HARK >100
THE
BUTPUT YOU RRR DS OU BE aAg tana He
make"
INPUT Maule
EndaP
UNTIL. MOA. 2. 0... AND. MARK.£.510.0.
TE Mask > Higher
Twen \ ”
ty = OUTPUT “The max markis’,
Wala
ENDIF ae
’
uTPUT " The loawbmrantls
TF Mark 2 bowser
oTAEN Lovarnaah
powmeanla 47 MNeN tet
purpuT Ye total 6", TM
éubtF
qoval.a ‘robe. # mank
Heap manatees No,aperariee +1
ENDIF
pwTil Mace 2444@ Devise another set of test data that includes normal, ezraneous and extreme data end complete
@ trace table to perform a dry run on your algoremnm
Nornad £21,995, 1 Aensimatic (-5)
Test data:
Exel 0100.1 Boundary ..te!),20100)2 |
Trace table:
or
EEL O05 ho Finds mys
nat be o-fo0
Nous mate Ls ouk vp vepye
” Eels &R4 so fies, moos
ma} be O=19030.
The following flowchart shows an algorithm that checks a temperature input is between 20 and
30 degrees. It contains several errors.
CA
Cay
LEX] INPUT
C6 Tera Tdentify the errors in the algorithm and the flowchart constructionb
raw the corrected flowchart.
‘hp "ead the top
Ye T
ys
Te20?
es
no
aN Yea
o]p “Snape”
Gr)
p "Too Ligh
T3730 7 oli Ls
[ieee
no
ve