DIS
Table’of’Contents
1. Introduction’to’Computers’and’Programming
2. Input,’Processing,’and’Output
3. Decision’Structures’and’Boolean’Logic
4. Repetition’Structures
5. Functions
6. Files’and’Exceptions
7. Lists’and’Tuples
8. More’About’Strings
9. Dictionaries’and’Sets
10. Classes’and’Object-Oriented’Programming
11. Inheritance
12. Recursion
13. GUI’Programming
14. Database’Programming
,Chapter’1’Introduction’to’Computers’and’Programming’Revie
w’Questions
Multiple’Choice
1. A(n) is’a’set’of’instructions’that’a’computer’follows’to’perform’a’task.
a. Compiler
b. Program
c. Interpreter
d. Programming’language
2. The’physical’devices’that’a’computer’is’made’of’are’referred’to’as .
a. Hardware
b. Software
c. The’operating’system
d. Tools
3. The’part’of’the’computer’that’runs’programs’is’called .
a. RAM
b. Second’storage
c. Main’memory
d. The’CPU
4. Today,’CPUs’are’small’chips’known’as .
a. ENIACs
b. Microprocessors
c. Memory’chips
d. Operating’systems
5. The’computer’stores’a’program’while’the’program’is’running,’as’well’as’the’data’the’the’pr
ogram’is’working’with,’in .
a. Secondary’storage
b. The’CPU
c. Main’Memory
d. The’microprocessor
6. This’is’a’volatile’type’of’memory’that’is’used’only’for’temporary’storage’while’a’program’is’
running.
a. RAM
b. Second’storage
c. The’disk’drive
d. The’usb’drive
7. A’type’of’memory’that’can’hold’data’for’long’periods’of’time,’even’when’there’is’no’po
wer’to’the’computer,’is’called .
a. RAM
b. Main’ memory
c. Second’storage
d. CPU’storage
, 8. A’component’that’collects’data’from’people’or’other’devices’and’sends’it’to’the’com
puter’is’called .
a. An’output’device
b. An’input’device
c. A’secondary’storage’device
d. Main’memory
9. A’video’display’is’a(n) device.
a. Output
b. Input
c. Second’storage
d. Main’memory
10. A is’enough’memory’to’store’a’letter’of’the’alphabet’or’a’small’number.
a. Byte
b. Bit
c. Switch
d. Transistor
11. A’byte’is’made’up’of’eight .
a. CPUs
b. Instructions
c. Variables
d. Bits
12. In‟the
numbering‟system,‟all‟numeric‟values‟are‟written‟in‟s
equences‟of‟0‟s‟and‟1‟s.
a. Hexadecimal
b. Binary
c. Octal
d. Decimal
13. A’bit’that’is’turned’off’represents’the’following’value:’
a. 1
b. -1
c. 0
d. “No”
14. A’set’of’128’numeric’codes’that’represent’the’English’letters,’various’punctuation’marks,’a
nd’other’characters’is .
a. Binary’numbering
b. ASCII
c. Unicode
d. ENIAC
15. An’excessive’encoding’scheme’that’can’represent’characters’for’many’languages’in’the’w
orld’is .
a. Binary’numbering
b. ASCII
c. Unicode
d. ENIAC
2 Jun’28,’2021
, 16. Negative’numbers’are’encoded’using’the technique.
a. Two‟s‟complement
b. Floating’point
c. ASCII
d. Unicode
17. Real’numbers’are’encoded’using’the technique.
a. Two‟s‟complement
b. Floating’point
c. ASCII
d. Unicode
18. The’tiny’dots’of’color’that’digital’images’are’composed’of’are’called .
a. Bits
b. Bytes
c. Color’packets
d. Pixels
19. If’you’were’to’look’at’a’machine’language’program’you’would’see .
a. Python’Code
b. A’stream’of’binary’numbers
c. English’words
d. Circuits
20. In’the part’of’the’fetch-decode-
execute’cycle,’the’CPU’determines’which’operation’it’should’perform.
a. Fetch
b. Decode
c. Execute
d. Deconstruct
21. Computers’can’only’execute’programs’that’are’written’in .
a. Java
b. Assembly’language
c. Machine’language
d. Python
22. The translates’an’assembly’language’program’to’a’machine’program.
a. Assembler
b. Compiler
c. Translator
d. Interpreter
23. The’words’that’make’up’a’high-level’programming’language’are’called .
a. Binary’instructions
b. Mnemonics
c. Commands
d. Key’words
3 Jun’28,’2021
, 24. The’rules’that’must’be’followed’when’writing’a’program’are’called’
a. Syntax
b. Punctuation
c. Key’Words
d. Operators
25. A(n) program’translates’a’high-
level’language’program’into’a’separate’machine’language’program.
a. Assembler
b. Compiler
c. Translator
d. utility
4 Jun’28,’2021
,True’or’False
1. Today,‟CPU‟s‟are‟huge‟devices‟made‟of‟electrical‟and‟mechanical‟components‟such‟as‟Va
cuum‟tubes‟and‟switches.
a. True
b. False
i. CPUs’were’huge’devices’made’of’electrical’and’mechanical’components’s
uch’as’switches’and’vacuum’tubes,’but’today's’CPUs’are’small’chips’ofte
n’called’microprocessors.’(p.3)
2. Main’memory’is’also’known’as’RAM.
a. True
i. Main’memory’is’commonly’known’as’random-
access’memory,’or’RAM.’It’is’called’this’because’the’CPU’is’able’to’quickl
y’access’data’stored’at’any’random’location’in’RAM.’RAM’is’considered’a’
volatile’type’of’memory’that’is’used’only’for’temporary’storage’while’a’pro
gram’is’running.’When’the’computer’is’turned’off,’the’contents’of’the’RAM
’are’erased.’(p.5)
b. False
3. Any‟piece‟of‟data‟that‟is‟stored‟in‟a‟computer‟s‟memory‟must‟be‟stored‟as‟a‟binary‟num
ber.
a. True
i. All‟data‟that‟is‟stored‟in‟a‟computer‟is‟converted‟to‟a‟sequence‟of‟0‟s‟and‟1‟s.‟
Computer‟scientists‟think‟of‟bits‟as‟tiny‟switches‟that‟can‟either‟be‟on‟or‟off.‟Bi
ts‟aren‟t‟actual‟“switches”„however,‟at‟least‟not‟in‟the‟normal‟sense.‟In‟most‟c
omputer‟systems,‟bits‟are‟tiny‟electrical‟components‟that‟can‟hold‟a‟positive‟
or‟a‟negative‟charge.‟Computer‟scientists‟think‟the‟positive‟charge‟is‟a‟switc
h‟in‟the‟on‟position,‟and‟one‟in‟the‟negative‟position‟as‟off.‟(p.7,8)
b. False
4. Images,’like’the’ones’created’with’your’digital’camera,’cannot’be’stored’as’binary’n
umbers.
a. True
b. False
i. Computers‟are‟often‟referred‟to‟as‟digital‟devices.‟The‟term‟digital‟device‟ca
n‟be‟used‟to‟describe‟anything‟that‟uses‟binary‟numbers.‟Digital‟data‟is‟data‟
that‟is‟stored‟in‟binary‟format,‟and‟a‟digital‟device‟is‟any‟device‟that‟works‟wi
th‟binary‟data.‟Consider‟the‟pictures‟taken‟with‟a‟digital‟camera.‟These‟imag
es‟are‟composed‟of‟tiny‟dots‟of‟color‟known‟as‟pixels.‟Each‟pixel‟in‟an‟image
‟is‟converted‟to‟a‟numeric‟code‟that‟represents‟the‟pixel‟s‟color.‟The‟numeri
c‟code‟is‟stored‟in‟memory‟as‟a‟binary‟number.‟(p.12)
5 Jun’28,’2021
, 5. Machine’language’is’the’only’language’that’a’CPU’understands.
a. True
i. A‟computer‟s‟CPU‟can‟only‟understand‟machine‟language.‟A‟CPU‟sees‟a‟ser
ies‟of‟1‟s‟and‟0‟s‟as‟an‟instruction‟to‟perform‟an‟operation.‟It‟is‟written‟in‟1‟s‟a
nd‟0‟s‟because‟the‟CPU‟only‟understands‟instructions‟written‟in‟machine‟lan
guage,‟and‟machine‟language‟instructions‟always‟have‟an‟underlying‟binar
y‟structure.‟(p.12,13)
b. False
6. Assembly’language’is’considered’a’high-level’language.
a. True
b. False
i. Although’assembly’language’makes’it’unnecessary’to’write’binary’machi
ne’language’instructions,’it’is’not’without’difficulties.’Assembly’Language
’is’primarily’a’direct’substitute’for’machine’language,’and’like’machine’la
nguage,’it’requires’that’you’know’a’lot’about’the’CPU.’Assembly’Langua
ge’also’requires’that’you’write’a’large’number’of’instructions’for’even’the’
simplest’program.’Because’assembly’language’is’so’close’in’nature’to’m
achine’language,’it’is’referred’to’as’a’low-level’language.’(p.16)
7. An’interpreter’is’a’program’that’both’translates’and’executes’the’instructions’in’a’high’le
vel’language’program.
a. True
i. The’python’language’uses’an’interpreter,’which’is’a’program’that’both’tran
slates’and’executes’the’instructions’in’a’high-
level’language’program.’As’an’interpreter’reads’each’individual’instruction’
in’the’program,’it’converts’it’to’machine’language’instructions’and’immedia
tely’executes’them.’This’process’repeats’for’every’instruction’in’the’progra
m.’Because’interpreters’combine’translation’and’execution,’they’typically’
do’not’create’separate’machine’language’programs.’(p.19)
b. False
8. A’syntax’error’does’not’prevent’a’program’from’being’compiled’and’executed.
a. True
b. False
i. If’the’code’contains’a’syntax’error,’however,’it’can’not’be’translated.’A’syn
tax’error’is’a’mistake’such’as’a’misspelled’keyword,’a’missing’punctuatio
n’character,’or’the’incorrect’use’of’the’operator.’When’this’happens,’the’c
ompiler’or’interpreter’displays’an’error’message’indicating’that’the’progra
m’contains’a’syntax’error.’The’Programmer’corrects’the’error’then’attemp
ts’once’again’to’translate’the’program.’(p.19)
6 Jun’28,’2021