Primitive Data Types Complete the table below Data
Primitive Data Types Complete the table below. Data Type Integer Description A whole number What do I actually need to know? Examples 5, 0, -5 Memory Used 2 -4 bytes Real/Float A decimal number 3. 14 4 -8 bytes Boolean One of two options True/Fal se 1 bit, but 1 byte used Character String A single letter, number or symbol H, 4, @ 1 byte A collection of characters “P 4 ssw 0 rd! 1 byte ” per Primitive Data Type • The basic data types provided by a programming language (e. g. integer, string, character, real/float and Boolean) What area of the specification does this cover? 1. 4 Data Types a) Primitive Data Types characte r
Primitive Data Types An algorithm asks for an ID number, username and password. Before they log in, the algorithm also requires a security passcode and a letter from an answer to a security question. List the most appropriate data types for this program and justify your decisions. [5] Data Type Justification ID Number Integer This is likely to be comprised of purely numbers, so an integer would be best fit Username String The username would be a collection of characters, such as letters and maybe numbers Password String The password would be a collection of characters, such as letters, numbers and symbols Security Passcode Integer The passcode is likely to be a number, so integer would be the best data type Security Letter This will be an option, perhaps from a drop-down menu, to select a single letter or number which is a character Character What do I actually need to know? Primitive Data Type • The basic data types provided by a programming language (e. g. integer, string, character, real/float and Boolean) What area of the specification does this cover? 1. 4 Data Types a) Primitive Data Types
- Slides: 2