Activity: Soda Pop Machine

This activity will provide you and your partner with experience in constructing flowcharts using the LucidChart application. This activity will also provide further experience in using conditional selection & repetition logic in algorithm/flowchart design. At the end of this activity, you will…

  • Be able to create a functional description of the problem.
  • Be able to construct processing steps to solve the given problem.
  • Be able to document the functional description of the problem as flowchart comments.

The Problem

Sally is thirsty. She walks over to a normal soda pop machine to get her favorite beverage – Mountain Sweat soda pop. Sally begins to put quarters into the machine. Just then, she wonders: how does this machine work? Sally thinks for a minute. Each soda pop can costs 75 cents. The machine will accept only quarters (25 cents) and rejects all others. The machine is smart in that it will not dispense a soda pop can unless enough money has been entered.

The Assignment

You have been asked to construct a flowchart which simulates a soda pop machine. Your flowchart/algorithm should accept as input only quarters, one at a time. All other coins should be dispensed back to the user. Once 75 cents have been received, the machine should provide the user with a can of Mountain Sweat. Your flowchart should have at least one loop and at least two conditional steps.

Desk-check your solution using the provided test cases below. Does the flowchart/algorithm work? If not, make any necessary corrections. Don’t forget to add one comment per step!

Test Case #1: Correct Input

  • Input: Try entering in quarters to reach 75 cents – one at a time!
  • Expected Output: Output the soda pop.

Test Case #2: Incorrect Input

  • Input: Try entering in a coin that is not a quarter (e.g. a dime or nickel).
  • Expected Output: Inform the user of his or her mistake, and return all change to the user.

When you have completed the flowchart, download it as a PDF file (see the File menu in LucidChart) and upload it to the Canvas dropbox. Upload only one submission per team!