

ī) If a match is found, the statement sequence following that case label is executed.Ĭ) If the value of expression does not equal to value-1, value-2. The flowchart of java switch statement for the selection process is shown in the below figure.Ī) When the switch statement is executed, the value of the expression is successively compared with each case value like value-1, value2. One or two spaces is insufficient.D) The statement sequence is a list of statements and may contain zero or more statements.Į) After each case, a break statement is necessary inside the switch block to come out switch block.į) The default statement sequence is optional and is executed when none of the previous cases are matched. aĬonsistent number of spaces, such as four.

Within IFs, FOR loops, WILLE loops, SWITCH statements, etc.

"initialize count to zero"įunction Calls, Function Documentation, and Pseudocode But do cite variables that are initialized as part of their declarations.Do not include data declarations in your pseudocode.As noted above, the pseudocode entries are to be cryptic, AND SHOULD NOT BE.INDENTATION in pseudocode should be identical to its implementation in a.More on Formatting and Conventions in Pseudocoding Also, using words such as Set and Initialize, whenĪssigning values to variables is also desirable. with careful indentation tend toįoster desirable pseudocode. print,ĭisplay, input, output, edit, test, etc. Set, reset, increment, compute, calculate, add, sum, multiply. Return When Always use scopeĪs verbs, use the words Generate, Compute, Process, etc.

Įndloop is also VERY good and is language independent. Some Keywords That Should be Used And Additional Pointsįor looping and selection, The keywords that are to be used include Do While student counter is less than or equal to ten Set the average to the total divided by the counter Input the next grade (possibly the sentinel) While the user has not as yet entered the sentinel Set the class average to the total divided by ten While grade counter is less than or equal to ten If student's grade is greater than or equal to 60 Of pseudocode to elaborate on the algorithmic detail and not just cite an abstraction. GUIDE TO PSEUDOCODE LEVEL OF DETAIL: Given record/file descriptions, pseudocode should beĬreated in sufficient detail so as to directly support the programming effort. These include while, do, for, if, switch. The rules of Pseudocode are reasonably straightforward. Pseudocode is a "text-based" detail (algorithmic) design tool. Pseudocode is an artificial and informal language that helps programmers developĪlgorithms. Statement, and the iteration is satisfied by a number of statements, such as the "while," "ĭo," and the "for," while the case-type statement is satisfied by the "switch" statement. In C, "sequence statements" are imperatives. "selection, " "iteration," and a case-type statement. Sequence of steps taken to solve a problem. An algorithm is a procedure for solving a problem in terms of the actions to be executedĪnd the order in which those actions are to be executed.
