Title:
Logical problem solving : before the flowchart, with C++ and visual basic applications
Personal Author:
Publication Information:
Upper Saddle River, NJ : Prentice Hall, 2002
Physical Description:
xvi, 391 p. : ill. ; 24 cm.
ISBN:
9780130618825
Available:*
Library | Item Barcode | Call Number | Material Type | Item Category 1 | Status |
---|---|---|---|---|---|
Searching... | 30000010183995 | QA76.73.C153 L34 2002 | Open Access Book | Book | Searching... |
On Order
Summary
Summary
This book shows readers how to best attack a wide variety of problems that they may not have previously solved. It focuses on techniques for developing the logic required to solve problems and how that logic is translated into writing effective computer programs. The author uses a consistent structure throughout the book of introducing a problem and formulating the solution based on a set of rules for creative problem solving. The solution is then represented first in pseudocode, then in a flowchart, then in C++ and finally in Visual Basic. This approach provides readers with a strong foundation in problem solving that will benefit them in areas beyond programming.
Table of Contents
Preface | p. ix |
1 Understanding the Problem | p. 1 |
1.1 In the Beginning | p. 1 |
Rule 1 The Clarity Rule | p. 1 |
Problem 1.1 If a man is 6'1.5" tall, what is his height in centimeters? | p. 2 |
1.2 Including Common Information | p. 5 |
Problem 1.2 How much does 50 gallons of water weigh? | p. 5 |
Rule 2 The Units Rule | p. 6 |
1.3 Including Uncommon Information | p. 10 |
Problem 1.3 What Celsius temperature is equivalent to a given Fahrenheit temperature? | p. 10 |
Problem 1.3a What is the relationship between the Celsius and Fahrenheit scales? | p. 10 |
Problem 1.4 What is the area of a user-defined trapezoid? | p. 14 |
Rule 3 The Picture Rule | p. 14 |
Problem 1.5 Calculate the pull of gravity on an astronaut aboard the space shuttle | p. 18 |
1.4 Working Backward | p. 22 |
Rule 4 The Working Backward Rule | p. 23 |
Problem 1.6 Calculate the number of molecules in a certain amount of chemical compound | p. 23 |
1.5 Working Backward-A Ball Is Dropped from a Tall Building | p. 27 |
Problem 1.7 If a ball is dropped from a tall building, how far does it travel in the first second, the second second, the third second, and the fourth second? | p. 28 |
2 Repetition | p. 33 |
2.1 The Power of the Personal Computer | p. 33 |
Rule 5 The Repetition Rule | p. 33 |
2.2 The Falling Ball | p. 34 |
Problem 2.1 If a ball is dropped from a sufficient height, how far does it travel each second and what is its speed at the end of each second for the first 20 seconds? | p. 34 |
Rule 6 The Clarity in Loops Rule | p. 34 |
Rule 7 The Limit of the Problem Rule | p. 38 |
2.3 The Penny Problem | p. 41 |
Problem 2.2 What is the value, mass, and volume of a stack of pennies? | p. 41 |
2.4 Grade Point Average | p. 50 |
Problem 2.3 What is the grade point average for a given set of grades? | p. 50 |
2.5 Binary Conversion | p. 57 |
Problem 2.4 How can an arbitrary positive integer be converted from decimal (base 10) to binary (base 2)? | p. 58 |
Rule 8 The Concrete Example Rule | p. 58 |
2.6 Daily Compounded Interest | p. 65 |
Problem 2.5 Determine the value of a savings account | p. 65 |
2.7 The Wall Problem | p. 72 |
Problem 2.6 Is it possible to walk to a wall? | p. 73 |
Rule 9 The Successive Approximation Rule | p. 73 |
2.8 Superfly | p. 77 |
Problem 2.7 How long was Superfly's last flight? | p. 77 |
2.9 MacLaurin Series Expansion | p. 85 |
Problem 2.8 Calculate the value of the sine function for an arbitrary angle | p. 86 |
3 Zeroing in on Solutions | p. 92 |
3.1 Strategic Guessing | p. 92 |
3.2 Calculating Square Roots | p. 93 |
Rule 10 Strategic Guessing Rule | p. 93 |
Problem 3.1 Find the square root of a number greater than one | p. 94 |
3.3 Improved Strategic Guessing--Newton-Raphson Method | p. 99 |
Problem 3.2 Find the square root of a positive number using the Newton-Raphson Method | p. 101 |
3.4 The Ladder Problem | p. 105 |
Problem 3.3 The ladder problem involves two ladders in an alley | p. 106 |
3.5 The Unsolvable Equation | p. 114 |
Problem 3.4 How can you find the solutions to a fifth-order equation? | p. 115 |
Rule 11 The Functions Rule | p. 117 |
4 Brute Force | p. 125 |
4.1 Nonstrategic Guessing | p. 125 |
Rule 12 The Brute Force Rule | p. 125 |
4.2 The Liars Problem | p. 125 |
Problem 4.1 The Liars Problem | p. 126 |
Rule 13 The Self-Consistency Rule | p. 126 |
4.3 The Comedians' Hats | p. 128 |
Problem 4.2 The Comedian's Hats Problem | p. 128 |
4.4 Prime Numbers | p. 130 |
Problem 4.3 Determine whether a number less than four billion is prime and, if not, what are the prime factors | p. 130 |
4.5 Searching Routines | p. 137 |
Problem 4.4 Divide a sentence provided by the user into its component words | p. 137 |
Problem 4.5 What are the most commonly used letters in the English language? | p. 143 |
4.6 Sorting Routines | p. 150 |
Problem 4.6 How can a list of 20 numbers be sorted? | p. 150 |
Problem 4.7 Sort a list of 20 students by their grades using a bubble sort routine | p. 158 |
4.7 Combining Searching and Sorting | p. 165 |
Problem 4.8 Create an index for text entered by the user | p. 165 |
5 Look-Up Tables | p. 174 |
5.1 The Look-Up Table | p. 174 |
Problem 5.1 Encode and decode a message with an unbreakable code | p. 174 |
5.2 The Understood Look-Up Table | p. 188 |
Problem 5.2 How can 50-digit positive numbers be added together? | p. 188 |
5.3 The Unsolvable Problem | p. 199 |
Problem 5.3 The Traveling Salesman Problem | p. 199 |
6 Simulations | p. 212 |
6.1 Probabilities | p. 212 |
6.2 Calculating the Odds | p. 212 |
Problem 6.1 The Coin Flip Problem | p. 212 |
Rule 14 The Probability Rule | p. 213 |
Problem 6.2 What are the odds of winning a game of craps on the first roll? | p. 218 |
Problem 6.3 The Monopoly Problem | p. 225 |
6.3 The "What If" Scenario | p. 232 |
Problem 6.4 The Perfect Shuffle Problem | p. 233 |
6.4 Geometric Probability | p. 242 |
Problem 6.5 Buffon's Needle | p. 243 |
6.5 Integral Calculus | p. 249 |
Problem 6.6 The Basketball Court Problem | p. 249 |
Rule 15 The Approximation Rule | p. 251 |
7 Removing the Limits | p. 259 |
7.1 Limitations in Accuracy | p. 259 |
7.2 Limitations in Scope | p. 260 |
Problem 7.1 Find the square root of any rational number | p. 260 |
Rule 16 The Expansion Rule | p. 260 |
Problem 7.2 Convert any rational decimal number into binary | p. 265 |
7.3 Limitations in Conditions | p. 270 |
Problem 7.3 Craps Problem Expanded | p. 270 |
7.4 Elimination of the Random Number Bias | p. 275 |
7.5 Limitations in Options | p. 276 |
Problem 7.4 Binary Conversion Second Expansion | p. 277 |
7.6 Limitations in Utility | p. 285 |
Problem 7.5 Encryption Problem Expanded | p. 286 |
Problem 7.6 Letter Frequency Problem Expanded | p. 297 |
Problem 7.7 Letter Frequency Problem with Sorting | p. 302 |
Problem 7.8 Satellite Orbit Problem | p. 308 |
Problem 7.9 Geosynchronous Orbit Problem | p. 315 |
8 Advanced Techniques | p. 321 |
8.1 Error Trapping | p. 321 |
Problem 8.1 The Reciprocal Problem | p. 322 |
8.2 Handling Input | p. 325 |
Problem 8.2 The Floating-point Input Problem | p. 326 |
8.3 The Advantages of Objects | p. 332 |
Problem 8.3 The Money Problem | p. 333 |
Problem 8.4 The Word Count and Sort Problem | p. 338 |
8.4 Recursion | p. 350 |
Problem 8.5 Generating Factorials | p. 350 |
Rule 17 The Recursion Rule | p. 350 |
Problem 8.6 Tower of Hanoi | p. 355 |
Problem 8.7 The Traveling Salesman Revisited | p. 361 |
9 Epilog | p. 375 |
9.1 Rule Zero | p. 375 |
Appendix A | p. 377 |
Appendix B | p. 379 |
Appendix C | p. 381 |
Appendix D | p. 383 |
Appendix E | p. 385 |
Index | p. 386 |