Pseudocode · Viking Code School

Pseudocoding for Grocery Shopping

The following is a program to go grocery shopping using pseudocode. This is the second of three pseudocoded programs written for an assignment for the Software Engineering Basics course of Viking Code School’s prep work.

Pseudocode is the process of writing out the logic of solutions to specific coding challenges using plain English. It is a good way to write out all of the code you will need to write before actually coding and is not very time consuming.

Part of the considerations for this assignments included:

  • the shopper has a list with a variable number of things that need to be procured from the grocery store
  • the store is laid out in 10 aisles
  • the signs for the aisles have all been taken down for repairs, so you cannot be sure which aisles contain which foods

While I start by defining the “list” variable with a set of string items, the integer variable x accounts for the list total, meaning that additional variable items can be added to the list and the program still functions.

grocery-pseudocode

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s