23.08.2019
 It 210 Checkpoint Dissertation

Connect Program Materials

Appendix They would

Repetition and Decision Control Structures

In one of the week several discussion concerns we reviewed the protocol that would be needed to make a peanut butter sandwich. In this CheckPoint you will have to take the particular one step further and create a program style to make a peanut butter casse-cro?te. Below you can find a partial program design; you should complete this by adding the pseudocode in the needed areas. You need to add one particular repetition (loop) control framework and one decision control to full the program design and style. The user will decide how various sandwiches are manufactured; this is where the loop to be used. The user will certainly decide if the sandwich contains jelly, and, if it truly does, what flavour of jello; to keep it simple we are only allowing grape or strawberry jelly.

Analysis

Process:

1 ) Ask customer how many sandwiches for making

2 . Inquire user if perhaps they want jelly on their sandwich

3. In the event jelly is definitely requested, ask user what flavor (grape or strawberry) of jelly they would like 4. Produce peanut butter and, in the event required, jelly sandwiches

Type:

NumberOfSandwiches (integer)

IncludeJelly (string; values Yes/No)

TypeOfJelly(string; principles Grape/Strawberry)

Result:

Sandwich

Design and style

Main Module

Declare NumberOfSandwiches as integer

Declare IncludeJelly as string

Declare TypeOfJelly as thread

Declare Continue as Boolean

Set Still true

Carry out While Continue = authentic

Call InputModule

EndDo

End Main Module

InputModule

Screen " How many casse-cro?te would you like to make? Enter 0 to end program. " Insight NumberOfSandwiches

In the event NumberOfSandwiches = 0

Collection Continue sama dengan false

Else

Display " Do you want jelly on your casse-cro?te? "

Input IncludeJelly

If IncludeJelly = " Yes”

Display " What type of jelly; Grape or Strawberry? ” Input TypeOfJelly

EndIf

established...