The = 4.0) *^*^* Character (a, F,

The most commonly
supported data types in programming languages are:

 

 

 

 

 

*^*^*

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

 

Data can be either
numbers, characters or logical

 

*^*^*

 

Integer

(whole number 4, 27,
65535)

1 to 8 bytes

 

Most programming
languages have different data types for whole and real numbers. This is because
they are represented differently inside the computer.

 

Whole numbers, called
integers (and ‘int’ for short in various programming languages), are
represented as single sets of binary numbers inside a computer.

 

A variety of mathematical
operations (e.g. addition, multiplication and division) can be done to these as
they fall under the number data type.

 

*^*^*

 

Floating point

(decimal number 4.2,
27.4, 5.63)

4 to 8 bytes

 

Any numbers which have
decimal points, called real or floating point numbers (and ‘float’, ‘single’,
‘double’, ‘real’ or ‘longreal’ in various other instances), are usually
represented using floating point representation inside a computer. This is
where the number is split into two parts: the main number (everything before
the decimal point) and the fractional part (everything after the decimal
point), both of which are binary numbers.

 

A variety of mathematical
operations (e.g. addition, multiplication and division) can be done to theses as
they fall under the number data type.

 

***Is this what is on
the BBC website??***

It is important to note
that adding two real numbers will always result in a floating point number (e.g
1.5 + 2.5 = 4.0)

 

*^*^*

 

Character

(a, F, 3, $, £, #)

1 byte

 

Data which is a
character (or ‘char’) can be any character from a specific character set, such
as ASCII or Unicode, represented by its own binary pattern. Characters can be
letters, digits or punctuation marks, and even tabs or spaces.

 

***Operations?***

 

*^*^*

 

String

(abc, hello world)

Limited to the amount
that can be stored in main memory

 

Ordered sequences of
more than one character in length are called strings. These can be made of any
combination of either different or repeated characters. There is usually a
restriction on the length of a string, which is how many characters it
contains, and empty strings – strings with no characters in them and therefore
a length of 0 – are also possible. All keyboard input and text output is in the
form of character strings.

 

***Operations?***

 

*^*^*

***BOOLEAN***

 

Boolean

(true or false)

1 bit

 

The Boolean data type is
used for True or False values. These are the only two states which are possible
for this data type. Most programming languages will use the terms True and
False for Boolean data but it is actually represented as 1 (True) or 0 (False)
in a computer. This means it takes up only 1 bit of space.