It 210 Checkpoint

Topics: Programming language, Peanut butter and jelly sandwich, Peanut butter Pages: 3 (374 words) Published: June 28, 2013
Associate Program Material
Appendix H

Repetition and Decision Control Structures

In one of the week 3 discussion questions we discussed the algorithm that would be required to make a peanut butter sandwich. In this CheckPoint you will need to take that one step further and create a program design to make a peanut butter sandwiches. Below you will find a partial program design; you need to complete it by adding the pseudocode in the required areas. You need to add one repetition (loop) control structure and one decision control to complete the program design. The user will decide how many sandwiches are made; this is where the loop will be used. The user will decide if the sandwich includes jelly, and, if it does, what flavor of jelly; to keep it simple we are only allowing grape or strawberry jelly.


1. Ask user how many sandwiches to make
2. Ask user if they want jelly on their sandwich
3. If jelly is requested, ask user what flavor (grape or strawberry) of jelly they would like 4. Make peanut butter and, if required, jelly sandwiches

NumberOfSandwiches (integer)
IncludeJelly (string; values Yes/No)
TypeOfJelly(string; values Grape/Strawberry)



Main Module

Declare NumberOfSandwiches as integer
Declare IncludeJelly as string
Declare TypeOfJelly as string
Declare Continue as Boolean
Set Continue to true

Do While Continue = true
Call InputModule

End Main Module


Display "How many sandwiches would you like to make? Enter 0 to end program." Input NumberOfSandwiches

If NumberOfSandwiches = 0
Set Continue = false
Display "Do you want jelly on your sandwiches?"
Input IncludeJelly

If IncludeJelly = “Yes”
Display “What type of jelly; Grape or Strawberry?” Input TypeOfJelly
Continue Reading

Please join StudyMode to read the full document

You May Also Find These Documents Helpful

  • Essay about It 210 Checkpoint Week 2
  • Cjs 210 Week Checkpoint Essay
  • It 210 Week 8 Checkpoint Essay
  • Bus/210 Week 7 Checkpoint
  • Essay about Hcr 210 Checkpoint Week 1
  • Bus 210 Checkpoint
  • Bus 210 Week 2 Checkpoint Essay
  • Hcr 210 Internet Databases Checkpoint Essay

Become a StudyMode Member

Sign Up - It's Free