Solutions of Homework Assignment 1

advertisement
Coppin State College
COSC 199: Introduction to Computer Programming – Fall 2005
Homework Assignment 1 – 10 points
Due Date: February 3, 2005
Student’s Name: ____________________________________
NOTE: Staple this instruction page as a cover page to your submitted assignment. READ
the textbook pages 2 to 38. For your knowledge review the “Quick Check” and their
answers from pp.38-39. There will be a Quiz (10 to 15 mins) on February 3, 2005.
1. Review the solved “Exam Preparation Exercises” (even numbers) from page 1049.
Complete the “Exam Preparation Exercises” 1, 3, 5, 7, 9, 11, pp. 39-41. Submit your
answers in separate pages.
2. Fill up the blanks
a.
A general solution, or algorithm, is written during the ____Problem Solving________ phase of a
computer program's life cycle.
b.
Coding of an algorithm takes place during the _Implementation_____ phase of a computer program's
life cycle.
c.
Modifications are made to an existing computer program during the __Maintenance_____________
phase of the program's life cycle.
d.
A(n) ___algorithm___________ is a step-by-step procedure for solving a problem in a finite
amount of time.
e.
A(n) __programming language______ is a set of rules, symbols, and special words used to construct a
computer program.
f.
_Documentation_________ is the written text and comments that make a program easier for others to
understand, use, and modify.
g.
_Data______________ is information that has been put into a form that a computer can use.
h.
A single binary digit (that is, a single 1 or 0) is called a(n) ____bit___________.
i.
A sequence of 8 bits is known as a(n) __byte______________.
j.
_Machine language____________ is the language made up of binary-coded instructions that are used
directly by the computer.
k.
__Assembly language____________ is a low-level programming language in which a mnemonic is
used to represent each of the machine language instructions for a particular computer.
l.
A(n) __compiler___________ is a program that translates a high-level language program into machine
code.
m.
A program written in a high-level programming language is called the __source___________
program.
n.
A(n) __peripheral__________ is an input, output, or auxiliary storage device attached to a computer.
o.
The ___object_________ program is the machine language version of a source program.
p.
The __operating system_________ is the set of programs that manages all of a computer's resources.
q.
A(n) __interface____________ is a connecting link at a shared boundary that allows independent
systems to meet and act on or communicate with each other.
r.
In the "Building Block Approach__" problem-solving technique, you recognize any subtasks that have
been solved before and use those as solutions to part of the problem.
s.
In the "Means-Ends Analysis” problem-solving technique, you define the beginning and ending states
of the problem, then compare different methods for getting between them.
t.
In the "_divide and Conquer__" problem-solving technique, you break the problem up into smaller
pieces that have been solved before, then tie the pieces together into a complete solution.
Review the solved “Exam Preparation Exercises” (even numbers) from page
1049. Complete the “Exam Preparation Exercises” 1, 3, 5, 7, 9, 11, pp. 39-41. Submit your
answers in separate pages.
Answer to 1.
Chapter 1 Exam Preparation Exercises
1. a. v, b. i, c. viii, d. iii, e. iv, f. vii, g. vi, h. ii.
3. Concrete solution (program), test.
5. The steps never end. Changing the last step to say, “Repeat from first step until graduation,”
converts the sequence into an algorithm that eventually ends, assuming the person
will graduate from school some day. We can make sure that this loop ends by specifying
a condition that will definitely occur. For example, “Repeat from first step until last day
of classes.”
7. The program can be compiled on different computer systems without modification.
9. False. The editor is software rather than hardware.
11. Yes. If the software license restricts use to a single computer or a single user, then this is
a case of piracy, even though you split the cost.
Download