Data Types and Structures i - Primitive Data Types Flashcards
What is an integer? Give 1 example.
A whole number with no decimal places. (E.G. 1, 2, -1, 10)
What is a float? Give 1 example
(a.k.a. Real). A numeric value which contains decimal numbers. (E.G. 4.5, 1/2)
What is a Boolean piece of data? Give 2 examples
Hold one of two values. (E.G. (yes / no), (true / false))
What is a character? Give 1 example
A single character. (E.G. ‘a’, ‘B’, ‘7’ ‘/’)
What is a string? Give 1 example
A collection of characters including text, numbers, symbols, new lines and spaces. (E.G. “Manny is gay ;)”)
What is ASCII?
American Standard Code for Information Interchange. A set of digital codes representing letters, numerals, and other symbols, widely used as a standard format in the transfer of text between computers.
What is parity?
A function whose being even (or odd) provides and check on a set of binary values.
Why is parity used?
The same parity function is used by both the sender and receiver of the data (either odd or even) and so it can be used for error detection in the data. For example, if two computers are using even parity and receive an ASCII value containing an odd amount of 1s then it can be assumed there was an error and ask for retransmission.