. . . . . . .
ams 3rd Edition by Kenneth Lambert
. . . . .
Solution and Answer Guide For All Chapters 1-
. . . . . . .
13| A+ PASS GUARANTEED
. . .
Page.|.1
, CHAPTER.1,. INTRODUCTION.TABL
E.OF.CONTENTS
Exercise.Solutions 1
Exercise.1.1 1
Exercise.1.2 2
Exercise.1.3 3
Review.Questions.Answers 4
Programming.Exercises.Solutions 8
Debugging.Exercises.Solutions. 8
EXERCISE.SOLUTIONS.EXERCIS
E.1.1
1. List.three.common.types.of.computing.agents.
Solution:
Human.beings,.desktop.computers,.cell.phones
2. Write.an.algorithm.that.describes.the.second.part.of.the.process.of.making.change.(counting.out.the.coins.
and.bills).
Solution:
There.are.various.ways.to.do.this,.but.here.is.one:
Repeat
Select.the.largest.unit.of.money.that.is.less.than.or.equal.to.the.remaining.change.Subtract.this.unit.from.the.rema
ining.change
Until.the.remaining.change.is.0
The.collection.of.units.selected.represent.the.change
Page.|.2
,3. Write.an.algorithm.that.describes.a.common.task,.such.as.baking.a.cake.
Solution:
There.are.various.ways.to.do.this,.but.here.is.one:
Preheat.an.oven.to.375.degrees
Add.1.cup.of.water.and.1.egg.to.a.mixing.bowl
Beat.the.liquid.mixture.in.the.bowl.until.the.ingredients.are.blended.Add.the.contents.of.a.boxed.cake.mix.to.the.
mixing.bowl
Beat.the.mixture.in.the.bowl.until.the.ingredients.are.blended
Pour.the.contents.of.the.mixing.bowl.into.a.lightly.greased.cake.pan.Bake.the.cake.in.the.oven.for.45.minutes
4. Describe.an.instruction.that.is.not.well.defined.and.thus.could.not.be.included.as.a.step.in.an.algorithm..Give.a
n.example.of.such.an.instruction.
Solution:
Attempting.to.divide.a.number.by.0
5. In.what.sense.is.a.laptop.computer.a.general-purpose.problem-solving.machine?
Solution:
A.laptop.computer.is.a.general-purpose.problem-
solving.machine.because.it.is.programmable.and.can.solve.any.problem.for.which.there.is.an.algorithm.
6. List.four.devices.that.use.computers.and.describe.the.information.that.they.process..(Hint:.Think.of.the.input
s.and.outputs.of.the.devices.)
Solution:
Digital.camera—images,.music.player—sound,.cell.phone—text,.ATM—numbers
Page.|.3
, Page.|.4