Categories
  Encyclosphere.org ENCYCLOREADER
  supported by EncyclosphereKSF

Pseudocode

From Conservapedia - Reading time: 1 min

Pseudocode is a form of "mock" computer code. Unlike most computer code, it's intended to be understood only by humans, and usually can't be parsed by a compiler or interpreter. Pseudocode is often shorter than the equivalent source code, because it seeks to be more understandable by glossing over less important details. Pseudocode is used for instructional purposes (particularly in introductory courses), for discussing an algorithm in a somewhat language-neutral way, or for building an initial skeleton in a low-level design document.

Example[edit]

In C++ code, an "if/else" statement is as follows:
if ( pi < 4 ) {
 cout << "pi is approximately correct";
}
else if ( pi >= 4 ) {
 cout << "pi is not set correctly";
}
else {
 cout << "an error has occurred";
}

The pseudocode may look something like this:
if pi is < 4
 say "pi is approximately correct"
if pi is >= 4
 say "pi is not set correctly"
otherwise say "an error has occurred"

References[edit]


Licensed under CC BY-SA 3.0 | Source: https://www.conservapedia.com/Pseudocode
24 views | Status: cached on March 09 2023 07:44:56
↧ Download this article as ZWI file
Encyclosphere.org EncycloReader is supported by the EncyclosphereKSF