Primitive entities for algorithm development

For the Algorithms process it is necessary to learn to develop a set of elements.

All these elements with which these algorithms are built are based on a discipline called: Structured Programming.

Let’s start by learning the rules for turning mathematical formulas into computer-valid expressions, as well as differentiating constants and identifiers and simple data types.

Type of data

All data has a type associated with them. A data can be a single character, such as ‘b’, or an integer value such as 35. The data type determines the nature of the set of values ​​a variable can take.

Simple Data Types

Numerical Data:

They allow representing scalar values ​​numerically, this includes integers and real numbers. This type of data allows you to perform common arithmetic operations.

Logical data:

They are those that can only have two values ​​(true or false) since they represent the result of a comparison between other data (numeric or alphanumeric).

Alphanumeric data (string):

It is a sequence of alphanumeric characters that allow to represent identifiable values ​​in a descriptive way, this includes names of people, addresses, etc. It is possible to represent numbers as alphanumeric, but they lose their mathematical property, that is, it is not possible to do operations with them. This type of data is represented enclosed in quotation marks.

identifiers

Identifiers represent the data of a program (constants, variables, data types). An identifier is a sequence of characters that serves to identify a position in the computer’s memory, which allows access to its content.

Example:

” Name

» Num_hrs

» Qual2

Rules for forming an identifier

  • Must start with a letter (A to Z, upper or lower case) and must not contain blank spaces.
  • Letters, digits, and characters such as the underscore ( _ ) are allowed after the first character.
  • The length of identifiers can be several characters. But an average length of 8 characters is recommended.
  • The name of the identifier should give an idea of ​​the value it contains.
Loading Facebook Comments ...
Loading Disqus Comments ...