Find the bugs 1 your downloadable files for chapter 1

  • No School
  • AA 1
  • alexmunoz2019
  • 18
  • 100% (18) 18 out of 18 people found this document helpful

This preview shows page 17 - 19 out of 18 pages.

Find the Bugs1.Your downloadable files for Chapter 1 include DEBUG01-01.txt, DEBUG01-02.txt, and DEBUG01-03.txt. Each file starts with some comments (lines that begin with twoslashes) that describe the program. Examine the pseudocode that follows theintroductory comments, then find and correct all the bugs.
Programming Logic and Design, 9e Solutions 1-18 // milesPerGallon is computed using division output milesPerGallon // miles is misspelled, and the P in milesPerGallon should be uppercase stop // Program should end with stop DEBUG01-03 // This pseudocode is intended to describe // computing the per day cost of your rent // in a 30-day month start input rent costPerDay = rent / 30 // Comment indicates 30-day month output costPerDay // output should be costPerDay stop 2.Your downloadable files for Chapter 1 include a file named DEBUG01-04.jpg that contains a flowchart that contains syntax and/or logical errors. Examine the flowchartand then find and correct all the bugs. 1.Create the logic for a Mad Lib program that accepts five words from input, then creates and displays a short story or nursery rhyme that uses them.
Programming Logic and Design, 9e Solutions 1-19 Answer : Students’ answers will vary. But a simple solution could be: start input word1 input word2 input word3 input word4 input word5 output “Jack and Jill went up the ”, word1, “ to fetch a pail of ”, word2, . “Jack ”, word3, “ down and broke his ”, word4, and Jill came ”, word5, “ after.” stop

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture