Preface - Test Bank Instant

Full file at http://testbanksinstant.eu/ Solution-Manual-for-Problem-Solvingand-Program-Design-in-C-International-Edition,-7E-
Instructor’s Manual
Problem Solving and Program Design in C, 7e
Jeri Hanly & Elliot Koffman
Preface
This manual is designed to support instructors using the text Problem Solving and Program Design in
C, Seventh Edition by Jeri R. Hanly and Elliot B. Koffman.
This supplement includes
chapter-by-chapter summaries and suggestions, answers to internal self-check and programming
exercises, answers to the review questions for each chapter, a collection of true/false, multiple
choice, and short answer questions to assist in constructing chapter tests, and solutions to
selected programming projects.
We thank especially Joan C. Horvath of the Jet Propulsion Laboratory, California Institute of
download full file at http://testbankinstant.com
Full file at http://testbanksinstant.eu/ Solution-Manual-for-Problem-Solvingand-Program-Design-in-C-International-Edition,-7E-
Technology, for contributing her solution to one of the programming projects that she designed. We
are very grateful to Howard University former student Paul Onakoya and to University of Wyoming
former graduate student Mark A. Thoney, who wrote or verified solutions to numerous internal
exercises, review questions, and programming projects.
We thank also Temple University former
computer science students Lynne Doherty, Andrew Wrobel, Steve Babiak, and Donna Chrupcala, who
contributed solutions to internal exercises and review questions. We acknowledge the assistance of
University of Wyoming former computer science and engineering students Jim Anderson, Kenneth Bower,
Amy Fletcher, Joe Fuhrman, Chris Hansen, John Regnier, Russell Updike, and Brent Youngers, who
provided solutions to programming projects.
We wish to express special gratitude to Addison-Wesley Computer Science Executive Editor Michael
Hirsch and to Senior Project Manager Carole Snyder for their unfailing professional support.
J.R.H. and E.B.K.
download full file at http://testbankinstant.com
Full file at http://testbanksinstant.eu/ Solution-Manual-for-Problem-Solvingand-Program-Design-in-C-International-Edition,-7ENew to the Sixth and Seventh Editions
Chapter 0 discusses Computer Science as a career path and is intended to motivate students to studying Computer
Science as either a minor or major field of study. As an additional motivational tool, many Computer Science
faculty have recommended the use of graphics to make the study of introductory programming more fun and visually
appealing, and as a vehicle to help students understand how to use libraries and call functions. To facilitate this, we
have included several optional sections with graphics examples. The new graphics sections include:
Section 3.6: Introduction to Graphics
Section 5.11: Loops in Graphics Programs
Section 7.10: Graphics Programs with Arrays
To reduce the overhead required to introduce graphics, we decided to use WinBGIm (Windows BGI with mouse)
which is a package based on the Turbo Pascal BGI (Borland Graphics Interface) library. WinBGIm was created to
run on top of the Win32 library by Michael Main and his students at the University of Colorado. Several
development platforms appropriate for CS1 courses have incorporated WinBGIm. Quincy (developed by Al Stevens)
is an open-source student-oriented C++ IDE that includes WinBGIm as well as more advanced libraries
(http://www.codecutter.net/tools/quincy). A command-line platform based on the open-source GNU g++ compiler
and the emacs program editor is distributed by the University of Colorado
(http://www.codecutter.net/tools/winbgim). WinBGIm is also available for Bloodshed Software’s Dev-C++ and
Microsoft’s Visual Studio C++.
To enable use of the WinBGI graphics package, you need to create a Qunicy project. Select New > Project and the
first window below will pop up. Click on the “WinBGIm Graphics Application” radio button and the “With
Console” box will automatically be checked. Then type in the name of your project and select a target path and
working directory.
download full file at http://testbankinstant.com
Full file at http://testbanksinstant.eu/ Solution-Manual-for-Problem-Solvingand-Program-Design-in-C-International-Edition,-7EAfter the project is created, you must insert the necessary .cpp files in it. You do this by selecting Project > Insert
Files. Browse for the file that contains your graphics program. Then select Debug > Run or click on the Run icon
(the running person) in the tool bar.
Major changes to this edition are listed below.
· Chapters 3 (Functions), 5 (Loops), and 7 (Arrays) include optional sections on graphics programming
· Chapter 6 (Pointers and Modular Programming) includes a new section 6.1 on pointers
· New complete programs show use of if statements in Chapter 4
· New complete program shows use of switch statement in Chapter 4
· Chapter 7 (Simple Data Types) in previous edition is eliminated and its contents integrated into other chapters of
the book. Chapter 2 contains expanded material on data types and Chapter 5 (Loops) contains section on Iterative
Processing. The new Chapter 7 (Arrays) also introduces enumerated data types.
· Hardware examples in Chapter 1 are updated to reflect current technology
· Several chapters contain new programming project homework problems
Chapters 14 (Multiprocessing) and 15 (On to C++) have been moved to the web
(www.pearsonhighered.com/irc)
download full file at http://testbankinstant.com
Full file at http://testbanksinstant.eu/ Solution-Manual-for-Problem-Solvingand-Program-Design-in-C-International-Edition,-7EPart I
Pedagogical Notes
download full file at http://testbankinstant.com
Part IV - Selected Programming Project Solutions
Hanly/Koffman
Chapter 1
Instructor’s Manual
CS1 6e
Overview of Computers and Programming
Chapter Objectives
1.
Present a brief historical overview of the development of computers.
2.
Describe the major components of a computer system and how they work together to solve
problems and manipulate data.
3.
Define the major categories of software and the kinds of languages in which they are
implemented.
4.
Introduce the steps of the software development method.
5.
Explain the process of writing, compiling, and executing high-level language programs.
6.
Present the use of the software development method in the solution of an elementary
programming problem.
Notes and Suggestions
This chapter contains broad coverage of general information about computers, their history, major
components, and the process of developing programs. The amount of time spent on the above
objectives will be related to your students' previous experience with computers. If this is a
first course for most of your students, then you may want to proceed more slowly. Regardless of
your students' prior experience with computers, it would be advisable to augment the chapter with
demonstrations of the use of the program development environment on the computer system they will
be using for their programming assignments in this class.
Require students to use good programming style in their very first program and in all subsequent
coding assignments. If you have a strong preference for a style different from the style used in
the text, provide your students with an explicit list of guidelines to follow. The style in the
text follows very closely the style rules mandated for use by developers in two major C-using
corporations.
Be sure that all of your sample programs follow the rules that you want your
students to follow. To facilitate giving students specific recommendations for improving their
programs, distribute a key listing your normal deductions for failure to meet your expectations.
Using the letters from the key will save you a lot of writing. Here is a key you could use as a
first draft.
A.
B.
C.
D.
E.
F.
G.
H.
I.
J.
K.
Missing statement of purpose
Inadequate commenting
Names are not meaningful
Indentation does not indicate program structure
Program will not compile
Program produces incorrect results
Insufficient testing (program branch never executed, borderline case not
tested, prescribed test case results not submitted)
Output not annotated to demonstrate correctness of results
Program solves wrong problem
Algorithm inefficient or difficult to follow
Use of unnamed constant
Section 1.5 contains the first of
solutions to programming problems
motivate students to work through
programs that appear in the first
the methods discussed in the case
professionals.
% usually
deducted
8
8
8
4
100
20–100
4–20
8
8–100
10
4
several complete case studies that describe the development of
using the software development method. It may be difficult to
all the steps of the software development method on the easy
chapters of the text. It may be helpful to remind them that
studies are modeled after those used by modern computing
download full file at http://testbankinstant.com
Part IV - Selected Programming Project Solutions
Hanly/Koffman
Instructor’s Manual
CS1 6e
New Terms
Section 1.1
John Atanasoff
computer program
personal computer
mainframe
supercomputer
software
computer chip
minicomputer
workstation
ENIAC
hardware
binary number
palmtop computer
mouse
address
file
hard copy
disk
data retrieval
read-only memory(ROM)
memory cell
random access memory (RAM)
monitor
graphical user interface
optical drive
icon
file server
digital versatile disk (DVD)
megabyte
digital subscriber line (DSL)
secondary storage
disk drive
keyboard
modem
data file
bit
output device
hard disk
USB flash drive
local area network (LAN)
World Wide Web (WWW)
subdirectory
wireless network
cursor
directory
gigabyte
cable Internet access
syntax
machine language
COBOL
Java
system software
object file
compiler
word-processor
input data
high-level language
BASIC
LISP
C and C++
application software
operating system
syntax error
editor
loader
software development method
design
problem inputs
stepwise refinement
requirements specification
abstraction
implementation
problem outputs
divide and conquer
desk checking
Section 1.2
input device
printer
stored program concept
program file
main memory
byte
central processor unit (CPU)
data storage
volatile
output file
wide area network (WAN)
function keys
fetch an instruction
computer network
register
kilobyte
terabyte
Section 1.3
programming language
FORTRAN
assembly language
Ada
language standard
source file
integrated development environment
linker
program output
binary string
Section 1.4
software engineer
analysis
testing
subproblems
top-down design
maintenance
Chapter 2
Overview of C
Chapter Objectives
1.
Present the origins of the C language, and introduce the structure of simple C programs
through the presentation of small sample programs.
2.
Describe the simple data types int, double, and char.
3.
Discuss the internal representations of type int, double, and char values.
4.
Introduce the basic use of the input/output functions printf and scanf.
5.
Present the preprocessor directives #include and #define.
6.
Discuss the use of input and output format strings with placeholders for character and
numeric data.
7.
Introduce the proper use of comments as a means of program documentation.
8.
Present the assignment statement along with the basic arithmetic operators and type casts
download full file at http://testbankinstant.com
Part IV - Selected Programming Project Solutions
Hanly/Koffman
Instructor’s Manual
CS1 6e
and their use in writing simple arithmetic expressions.
9.
Describe the process of writing simple programs that perform input, computation of numeric
results, and output.
10.
Introduce the problem of numerical inaccuracies in computations using type double values.
11.
12.
Review automatic and explicit conversion of data types.
Discuss input/output redirection and program-controlled files, and present the differences
between interactive and batch processing of data.
download full file at http://testbankinstant.com