Chapter 1 Solutions
Chapter 1 Solutions
Short Answer
1. Both main memory and secondary storage are types of memory. Describe the difference
between the two.
Answer:-
a) Primary memory is volatile, the data stored is lost during a power outage, while secondary
memory is non-volatile, and the saved data is stored permanently.
b) Data stored in primary memory can be directly accessed by the CPU, whereas the data in
secondary memory cannot be accessed directly (the data is first read from secondary
memory into primary memory).
c) Access to Primary memory is fast whereas access to secondary memory is slow. Access time
for Primary memory is in nanoseconds (ns) and in milliseconds (ms) for the secondary
memory. Note that (1 second = 103 milliseconds = 109 nanoseconds)
d) Primary memory is costly and smaller in size (in Mega bytes) whereas secondary memory is
cheap and very large in size(in Tera bytes).
3. What type of software controls the internal operations of the computer’s hardware?
Answer:- The system software Operating system (OS) controls the internal operations of the
computer’s hardware and coordinates the computer hardware devices and runs other software
and applications on a computer.
4. Why must programs written in a high-level language be translated into machine
language before they can be run?
Answer:- Computers only understand and run programs written in machine language or
machine code. So to run a high-level program by a computer it must be translated into
its machine language.
5. Why is it easier to write a program in a high-level language than in machine language?
Answer:- High-level languages are English like languages and are understandable by humans.
6. Explain the difference between an object file and an executable file.
Answer: - An object file contains machine language instructions, but it does not contain code for
any library routines that may be necessary. Whereas an executable file is a program which is
ready to run.
Fill-in-the-Blank
Draw hierarchy charts or flowcharts that depict the programs described below. (See Appendix D for
instructions on creating flowcharts.)
Solution:
Program has Logical Error as it is calculating the area without asking the user for width and length of
the room. The correct program shall first ask the user for the values of length and width of the room
and then calculate area by multiplying the length with width.