Draw a flowchart or write pseudocode to represent the

This preview shows page 8 - 16 out of 28 pages.

5. Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter a value for one edge of a cube. The program calculates the surface area of one side of the
6. Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter two values. The program outputs the product of the two values.
Start Input myNumber1Input myNumber2 Set myAnswer = myNumber1 * myNumber2 Output myAnswer StopStartInputmyNumber1InputmyNumber2Set myAnswer = myNumber1 * myNumber2OutputmyAnswerStop
7. a. Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter values for the width and length of a room's floor in feet. The program outputs the area of the floor in square feet.
b. Modify the program that computes floor area to compute and output the number of 6-inch square tiles needed to tile the floor.
8. a. Draw a flowchart or write pseudocode to represent the logic of a program that allows the user to enter values for the width and length of a wall in feet. The program outputs the area of thewall in square feet.
b. Modify the program that computes wall area to allow the user to enter the price of a gallon of paint. Assume that a gallon of paint covers 350 square feet of a wall. The program outputs the number of gallons needed and the cost of the job. (For this exercise, assume that you do not needto account for windows or doors, and that you can purchase partial gallons of paint.)
StartInput wallWidth(feet)Input wallLength(feet)Input gallonPriceSet wallArea = wallWidth * wallLength Set numGallons = wallArea / 350Set cost = numGallons * gallonPriceOutput numGallons, costStop

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture