# Data Types in Flowgorithm Flowchart

### Overview

When we create or declare a variable in a Flowgorithm flowchart, we need to specify the data type of the variable. The data types that can be used in a Flowgorithm flowchart are as follows:

**Integer****Real****String****Boolean****Array**

### Integer

The Integer data type is the commonly used type. An integer variable is used to represent whole numbers. Whole numbers are numbers without fractions and are either positive or negative.

Example:

Number of students in a class is an integer datatype. We are sure that we cannot have 40 and a half students in a class.

NumberOfStudents = 40

### Real

The Real data type is used to represent numbers that can have fractions. These numbers can be either positive or negative. They have both theĀ whole part and the fractional part separated with a decimal. In programming languages like Java, this data type is float or double data type “double precision floating point”.

Example:

To represent height of the table we use Real data type. It is not necessary for the height to be always in whole numbers. To represent a table height of 34.5 inches.

HeightOfTable = 34.5

### String

The String data type is used to store text. This includes words, letters, digits, etc. The text should be surrounded by a pair of double-quotes.

Example:

The name of course is a String data type with letters and digits.

Name = “CS100”

### Boolean

The Boolean data type can only two values. It can store either “true” or “false” values. Boolean variables allow us to make decisions in the flowcharts.

Example:

A real world example of Boolean data type that can hold only two values is a fan switch. The switch can be in only two states either ON or OFF. The truth value of the Boolean expressions can be either true or false. In above example the height of the table is 34.5 inches. The truth values for the expression can be much like Yes or NO:

Is the table height greater than 20 inches ? -> true

Is the table height greater than 40 inches ? -> false

### Arrays

We will discuss Arrays in a separate tutorial.