Logic7e_Solutions_ch03 - Programming Logic and Design 7e...

This preview shows page 1 - 8 out of 37 pages.

Programming Logic and Design, 7eSolutions 3-1Programming Logic and Design, 7th EditionChapter 3Exercises1.In Figure 3-10 the process of buying and planting flowers in the spring was shown using the same structures as the generic example in Figure 3-9. Describe some other process with which you are familiar using exactly the same logic.
2.Each of the flowchart segments in Figure 3-25 is unstructured. Redraw each flowchart segment so that it does the same thing but is structured.
Programming Logic and Design, 7eSolutions 3-2a.b.
Programming Logic and Design, 7eSolutions 3-3c.
Programming Logic and Design, 7eSolutions 3-4d.
Programming Logic and Design, 7eSolutions 3-5e.3.Write pseudocode for each example (a through e) in Exercise 2 making sure your pseudocode is structured but accomplishes the same tasks as the flowchart segment.
Programming Logic and Design, 7eSolutions 3-6b. do Dif E is true thendo Hdo Ielsedo Fif G is true thendo Iendifendifc.do kif L is true thendo Pwhile Q is truedo Pendwhiledo Relsedo Mdo Nif O is true thendo Rendifendifd. do Sif T is true thendo Yif Z is true thendo Vif W is true thendo Aelsedo Xendifelsedo Aendifelsedo Udo Vif W is true thendo Aelsedo Xendifendif
Programming Logic and Design, 7eSolutions 3-7e. if B is true thendo Gwhile H is not truedo Ido Gendwhiledo Dwhile E is truedo Ido Dendwhiledo Felsedo Cdo Dwhile E is truedo Ido Dendwhiledo Fendif4.Assume you have created a mechanical arm that can hold a pen. The arm can performthe following tasks:Lower the pen to a piece of paper.Raise the pen from the paper.Move the pen 1 inch along a straight line. (If the pen is lowered, this action draws a one-inch line from left to right; if the pen is raised, this action just repositions the pen 1 inch to the right.)Turn 90 degrees to the right.Draw a circle that is 1 inch in diameter.Draw a structured flowchart or write structured pseudocode describing the logic that would cause the arm to draw the following:a.a 1-inch squareb.a 2-inch by one-inch rectanglec.a string of three beadsd. a short word (for example, cate. a four-digit number)

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture