Friday 25 January 2013

Data Types


The data the computer uses are of many different types.
Computer must be told about the data type of each variable or constant.

Numeric Data

  • Includes all types of numbers. The subtypes of numeric data type are Integer and Real
  • Integers are whole numbers
  • Real numbers or floating point numbers are whole numbers plus decimal parts
  • A real number can be represented in scientific notation such as 2.5E5 or 3.2E-3. No commas are used.

Character Data

  • The character data set consists of all single digit numbers, letters and special characters, available to the computer – placed within quotation marks.
  • An uppercase letter is considered different from a lowercase letter.
  • When more than one character is put together, the computer considers this item as a string.
  • Character and string data are compared and arranged in alphabetical order.
  • The computer gives each character a number (ASCII Codes). The numbers are compared to see which is larger and are then arranged in ascending order.
  • Upper case letters are given a smaller value than a lowercase letter.

Logical Data

  • Consists of only two values – true and false.
  • They are used in making yes-or-no decisions.
  • For example, to check the credit record.

No comments:

Post a Comment