Pseudocode

From Conservapedia

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]


Categories: [Computer Science]


Download as ZWI file | Last modified: 03/09/2023 07:45:49 | 20 views
☰ Source: https://www.conservapedia.com/Pseudocode | License: CC BY-SA 3.0

ZWI signed:
  Encycloreader by the Knowledge Standards Foundation (KSF) ✓[what is this?]