# Unit 6 Data Types Flashcards

1
Q

Integer

A

An integer is a ​whole number​. Integers include zero and negative numbers, they just ​can’t have a fractional part​. Integers are useful for ​counting ​things

2
Q

Real

A

Real numbers are positive or negative numbers which can, but do not necessarily, have a fractional part​. Reals are useful for measuring things. All integers are real numbers. Real numbers can also be represented using ​floating point​, which is explained later.

3
Q

Character

A

A character is a ​single symbol ​used by a computer. These include the letters A to Z, the numbers ​0​to ​9​and hundreds of symbols like %, £

4
Q

String

A

A string is a ​collection of characters​. While a string can be used to store a single character, they can also be used to store many characters in succession. Strings are useful for storingtextand​phonenumbers​whichstartwitha​0,​whichnumericdatatypeslike integers would cut off.

5
Q

Boolean

A

Named after the mathematician George Boole (hence written with a capital B), values taken by a Boolean data type are restricted to ​True​and ​False​. Booleans are useful for recording data that ​can only take two values​, like the state of a power button or whether a line of code has been executed.

6
Q

Binary to Decimal

A

The​ least significant bit ​of a binary number is the one furthest to the right, while the​ most significant bit​ is furthest to the left. When representing positive integers, the least significant bit always represents a value of 1, with the 2nd least significant bit representing a value of 2, then 4, 8, etc.

7
Q

Decimal to Binary

A

If you have a decimal (denary) number to convert into binary, the first step is to find the largest power of two​ which is ​smaller ​than the number you’re converting. Then write out place values in powers of two up to this power.