4.7: Character Sets & Data Types

Exam Board:

Eduqas / WJEC

Specification:

2016 + 

What is a Character Set?

A character set is a table that matches together a character and a binary value.

 

Character sets are necessary as they allow computers to exchange data.

Two common character sets are ASCII and Unicode.

ASCII

Unicode

(American Standard Code for Information Interchange)

0100 0001

0100 0010

 0100 0011

Uses Binary

128

Tiny Set of Characters

Less Memory Required per Character

U+0042

U+0055

U+004E

Uses Hexadecimal

137,000+ 

Large Set of Characters

More Memory Required per Character

What are the different data types?

When programming, variables should be given appropriate data types.

Character

String

Integer

A single character, such as a letter, number or punctuation symbol.

Examples:

A sequence of characters, including letters, numbers and punctuation.

Examples:

A whole number.

Examples:

T

8

?

Harry Waters

14:50pm

Ice Age 4

475

-8432

56732

Real

Boolean

Telephone numbers are always stored as a string, not an integer.

True / False

Yes / No

0 / 1

An answer that only has two possible values.

Examples:

A decimal number.

Examples:

65.3

-321.1234

909.135

Be careful with punctuation.

32.10 is a real but £32.10 is a string.

Questo's Questions

4.7 - Character Sets & Data Types:

 

1. What is a character set and why are they needed[2]

2. Describe 3 differences between ASCII and Unicode. [6]

3. State the 5 different data types. [5]

4. State which data type is most suitable for the following variables:

  • a. Age [1]

  • b. Surname [1]

  • c. Height (in metres) [1]

  • d. First Initial [1]

  • e. Phone number [1]

  • f. Right-Handed? [1]

© CSNewbs 2020