Looking up a word in a dictionary can be a

• Homework Help
• 33
• 96% (25) 24 out of 25 people found this document helpful

This preview shows page 19 - 27 out of 33 pages.

6. Looking up a word in a dictionary can be a complicated process. For example, assume you want to look up “logic.” You might open the dictionary to a random page and see “juice.” You know that word comes alphabetically before “logic,” so you flip forward and see “lamb.” That is still not far enough, so you flip forward and see “monkey.” That means you have gone too far, so now you flip back, and so on. Draw a structured flowchart or write pseudocode that describes the process of looking up a word in a dictionary. Pick a word at random and have a fellow student attempt to carry out your instructions.
Programming Logic and Design, 6e Solutions 3-20 7. Draw a structured flowchart or write structured pseudocode describing your preparation to go to work or school in the morning. Include at least two decisions and two loops.
Programming Logic and Design, 6e Solutions 3-21 Flowchart:
Programming Logic and Design, 6e Solutions 3-22 Pseudocode: start get out of bed while feeling awake is not true drink coffee endwhile if the outside temperature < 65 is true then wear sweater else wear t-shirt endif if you’re feeling hungry is true then eat breakfast endif while you have keys is not true search for keys endwhile drive to work stop 8. Draw a structured flowchart or write structured pseudocode describing your preparation to go to bed at night. Include at least two decisions and two loops.
Programming Logic and Design, 6e Solutions 3-23 Flowchart:
Programming Logic and Design, 6e Solutions 3-24 Pseudocode: start while teeth need brusing brush teeth endwhile if temperature is less than 65 degrees then wear flannel pajamas else wear cotton pajamas endif if tomorrow is a school day then set alarm clock endif while thirsty drink water endwhile get in bed stop 9. Draw a structured flowchart or write structured pseudocode describing how your paycheck is calculated. Include at least two decisions.
Programming Logic and Design, 6e Solutions 3-25 Pseudocode: start if the employee is full-time is true then weekly pay = 40 * pay rate if employee worked overtime is true then overtime pay = (hours worked – 40) * 1.5 * pay rate weekly pay = weekly pay + overtime pay endif else weekly pay = hours worked * pay rate endif net pay = weekly pay - taxes stop
Programming Logic and Design, 6e Solutions 3-26