The following is a program to make a grilled cheese sandwich using pseudocode. This is the first 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.
In the code below, I used a string variable with the three ingredients to cycle through them more easily. This is one element that may go beyond pseudocoding, but is a technique I have used in Java before. I thought it would be a good way to reduce the lines of code while still accomplishing the task in a simple way. I also added a reference to the GroceryShopping program if any ingredients are not present. The GroceryShopping program will be pseudocoded in my next post.