CSNP Homework 1-Chp1
CSNP Homework 1-Chp1
Homework #1 - Chapter 1
Read Chapter 1 and Complete the following Review Questions (4pts each):
Decode: In this step, the program instruction is encoded into a form of numbers, like 1s and 0s.
After, the control unit of the CPU decodes the instructions again and then generates a certain
electronic signal depending on what the program instruction said.
Execute: In the final step of this process, the electronic signal sent in the Decode step of the
process is directed and routed to the correct component, of the computer that the CPU’s control
unit sent the signal to. After the component received the electronic signal, the component
performs an operation based on what the electronic signal was and said.
5. What fundamental set of software controls the internal operations of the computer’s hardware:
A. Operating System
B. Utility Programs
C. Software Development Tools
D. Compilers
E. Linkers
6. If you were to look at a machine language program, you would see _____.
A. C++ source code
B. A stream of binary numbers
C. English words
D. Circuits
E. RAM
7. These are the rules that must be followed when writing a program: ______
A. Syntax
B. Punctuation
C. Key words
D. Operators 6
10. In the Software Development Model, which step is where writing the algorithm using
programming statements:______
A. Defining Problem Requirements
B. Analysis
C. Design
D. Implementation
E. Testing
F. Maintenance
12. These tools are combined into an IDE (Integrated Development Environment): (select all that
apply by highlighting in YELLOW)
A. Memory
B. Editor
C. Compiler
D. Tester
E. Linker
F. Loader
G. Debugger
13. What is the first large scale general purpose electronic digital computer called?
ENIAC
16. Why must programs written in a high-level language be translated into machine language before
they can be run?
The programs written in a high-level language must be translated into the machine language
before they can be run because the high-level language is readable by the programmer but is
unreadable to the computer. The computer can read machine language instructions because it is
made up 1s and 0s, the computer CPU can understand, and cannot read the words in the high-
level language
19. What happens to a variable’s current contents when a new value is stored there?
A. syntax error
B. runtime error
C. old value saved in RAM
D. contents are overwritten with new contents
E. old value persisted to secondary storage
The following are programs expressed as English statements (Pseudocode). What would each display
on the screen if they were actual programs?
23.
The variable x starts with the value 0.
The variable y starts with the value 5.
Add 1 to x.
Add 1 to y.
Add x and y, and store the result in y.
Display the value in y on the screen.
Answer: 7
24.
The variable a starts with the value 10.
The variable b starts with the value 2.
The variable c starts with the value 4.
Store the value of a times b in a.
Store the value of b times c in c.
Add a and c, and store the result in b.
Display the value in b on the screen.
Answer: 28 _______________________________
Page 6 of 6
The variable maxCreditAmount is defined as an int variable and starts with the value 0.
The variable creditAmountUsed is defined as an int variable and starts with the value 0.
The variable availableCredit is defined as an int variable and starts with the value 0.
The program asks the customer to type in an input value for maxCreditAmount.
Store the inputted value in maxCreditAmount.
The program asks the customer to type in an input value for creditAmountUsed.
Store the inputted value in creditAmountUsed.
Subtract maxCreditAmount by creditAmountUsed, and store the result in
availableCredit.
Display the value in availableCredit on the screen.