VCE IT Theory Slideshows By Mark Kelly vceit.com Version 2 – updated for 2016 Data Types 1 a.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Introduction Part 2: Data types and addressing modes dr.ir. A.C. Verschueren.
Advertisements

Primitive Data Types There are a number of common objects we encounter and are treated specially by almost any programming language These are called basic.
Constants and Data Types Constants Data Types Reading for this class: L&L,
VCE IT Theory Slideshows By Mark Kelly Vceit.com Naming Conventions for solution elements.
Types and Variables. Computer Programming 2 C++ in one page!
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
CIS 234: Using Data in Java Thanks to Dr. Ralph D. Westfall.
Chapter 3 Data Representation.
Chapter 3 Data Representation. Chapter goals Describe numbering systems and their use in data representation Compare and contrast various data representation.
8 November Forms and JavaScript. Types of Inputs Radio Buttons (select one of a list) Checkbox (select as many as wanted) Text inputs (user types text)
Data types and variables
PZ04A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ04A - Scalar and composite data Programming Language.
Data Representation Kieran Mathieson. Outline Digital constraints Data types Integer Real Character Boolean Memory address.
Chapter 2 Data Types, Declarations, and Displays
JavaScript, Third Edition
Bit Operations C is well suited to system programming because it contains operators that can manipulate data at the bit level –Example: The Internet requires.
A bit can have one of two values: 0 or 1. The C language provides four operators that can be used to perform bitwise operations on the individual bits.
String Escape Sequences
Storing data Getting data out Data types Ruby as a foundation Program Variables Click icon to hear comments (the download may take a minute)
Objectives You should be able to describe: Data Types
Cosc175/data1 Data comprised of constants and variables information stored in memory Each memory location has an address Address - number identifying a.
Basis Data Terapan Yoannita. SQL Server Data Types Character strings: Data typeDescriptionStorage char(n)Fixed-length character string. Maximum 8,000.
Java Primitives The Smallest Building Blocks of the Language (corresponds with Chapter 2)
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
National Diploma Unit 4 Introduction to Software Development Data types, variables and constants.
Cis303a_chapt03-2a.ppt Range Overflow Fixed length of bits to hold numeric data Can hold a maximum positive number (unsigned) X X X X X X X X X X X X X.
VCE IT Theory Slideshows By Mark Kelly vceit.com Data Types 1 a.
Java Data Types. Primitive Data Types Java has 8 primitive data types: – char: used to store a single character eg. G – boolean: used to store true or.
Logical or Boolean Data stored in Boolean form can only be one of two available values. Think of a light switch – it’s on or off. Examples include: YES.
Input, Output, and Processing
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Primitive Variables.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
 Character set is a set of valid characters that a language can recognise.  A character represents any letter, digit or any other sign  Java uses the.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
IT Applications Theory Slideshows By Mark Kelly Vceit.com Last modified : 6 Dec 2013 Databases II: Structure, naming, data types, data formats.
Data Types and Variables. Data Type! Computers are all about Data! Data can be in the form of Text Dates Sounds Pictures.
IT Applications Theory Slideshows Databases II: Structure, Naming, data types, data formats.
INT213-Week-2 Working with Variables. What is variable
VCE IT Theory Slideshows By Mark Kelly Vceit.com Arrays.
Chapter 4 Literals, Variables and Constants. #Page2 4.1 Literals Any numeric literal starting with 0x specifies that the following is a hexadecimal value.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
Data Tonga Institute of Higher Education. Variables Programs need to remember values.  Example: A program that keeps track of sales needs to remember.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Variables in VB. What is a variable? ► A named memory location that stores a value.
Types Chapter 2. C++ An Introduction to Computing, 3rd ed. 2 Objectives Observe types provided by C++ Literals of these types Explain syntax rules for.
Types Chapter 2. C++ An Introduction to Computing, 3rd ed. 2 Objectives Observe types provided by C++ Literals of these types Explain syntax rules for.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
VCE IT Theory Slideshows by Mark Kelly study design By Mark Kelly, vceit.com, Begin.
Primitive Data Types. int This is the type you are familiar with and have been using Stores an integer value (whole number) between -2,147,483,648 (-2.
Slide 1 Chapter 3 Variables  A variable is a name for a value stored in memory.  Variables are used in programs so that values can be represented with.
1 Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Scalar and composite data Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
MICROSFTACCESS tables. DATA TYPES Field TypeWhat It Holds Short Text Text up to 255 characters long (including spaces and punctuation). Use a Text field,
Data Types Mr Tottman Link. Data Types Programs need to use data for calculations and for output to various devices The best programs will always use.
© 2004 Pearson Addison-Wesley. All rights reserved August 27, 2007 Primitive Data Types ComS 207: Programming I (in Java) Iowa State University, FALL 2007.
VCE IT Theory Slideshows
VCE IT Theory Slideshows
IT Applications Theory Slideshows
Documentation Need to have documentation in all programs
Primitive Data Types August 28, 2006 ComS 207: Programming I (in Java)
VCE IT Theory Slideshows by Mark Kelly study design
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
Presentation transcript:

VCE IT Theory Slideshows By Mark Kelly vceit.com Version 2 – updated for 2016 Data Types 1 a

Mandated data types In the study design, there are no mandated data types. The Glossary only says… Data types are the particular forms that an item of data can take including numeric, character and Boolean, and are characterised by the kind of operations that can be performed on it... these fundamental types can be divided into more specific types, for example integer and floating point are numeric types. More sophisticated types can be derived from them, for example a string of characters or a date type. Their names may vary, such as text versus string.

Boolean (logic) Boolean - stores only a True or False value. Very efficient storage. Little memory required. Ideal for flags which store a yes/no true/false state. Note – just because a field or variable can take 1 of only 2 possible values does not make it Boolean. Boolean must be a true/false answer, not (for example) a “left-handed/right-handed” option.

Integer Cannot hold fractional parts (decimal places) Little storage needed compared with floating point numbers Quicker to do calculations with integers Some variants supported by different apps… – Short Integer - stores values from negative to – Long Integer - stores values from negative 2,147,483,648 to 2,147,483,647 – Byte - stores values between 0 and 255 in one byte. Efficient storage for small numbers.

Floating point numbers a.k.a. Decimal, Real Store numbers with a fractional (decimal) part (e.g ) Variants… – Single Precision - stores values from e38 to e-45 for negative values and from e-45 to e38 for positive values…

Floating Point Numbers – Double Precision - for storing values from e308 to e- 324 for negative values and from e-324 to e308 for positive values. – The 'e' means 'times 10 to the power of'. In other words e-324 is roughly 4.9 followed by 324 zeroes. It allows extreme precision...

Double precision! 49,000,000,000,000,000,000,000,000,000,000,0 00,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0 00,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0 00,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0 00,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000,0 00,000,000,000,000,000,000,000,000,000,000,000,000,000

Currency data type A special type of floating point used for finances. Has a high-precision fractional part to prevent bad rounding of cents.

String (text) String - stores text composed of any ASCII* characters (alphabetic letters, numerals, punctuation and control codes like carriage return, backspace, bell). Character - can hold a single ASCII character, e.g. “A”, “3”, “&”, tab character.

ASCIIASCII

String (text) While strings can store numerals, they cannot interpret the value of numbers and instead treats them as plain text. So if you add "1" and "2" you'll get "12" instead of 3 Beware of this when adding numbers in text boxes!

Special data Date - holds a complete date value (including day, month and year). Stored as a number. Time – stores a time of day as a number of seconds since midnight Timestamp - holds a complete date (DDMMYYYY) and time of day (hours, minutes and seconds) in a single value. Stored as a number.

Special types The programming language C has a special data type designed to hold a pointer to a memory location. Filemaker Pro databases have a container data type which can hold any binary data like video, photo, audio, word processor documents etc Different software may support other data types (e.g. nybble – half a byte)

Why bother with data types? Use the right data type to get maximum manipulation power E.g. When a date is stored as “Date” data type instead of text, the software can perform data calculations Age  (DateToday – DateBirth)/365

Why bother with data types? Use the right size data type to avoid wasted memory (e.g. using double when byte would do, or using float when number will always be integer) Programs run faster when using smaller, simpler variables. Calculations using decimal places takes extra processing.

Using GUI storage structures Textboxes can store numbers, but to do calculations, the text must be converted to number format first. (Slow, painful) List boxes/combo boxes are good for displaying data, but not efficient for large storage and manipulation tasks compared with arrays.

Also see Naming conventions for variables etc Naming conventions

By Mark Kelly vceit.com These slideshows may be freely used, modified or distributed by teachers and students anywhere on the planet (but not elsewhere). They may NOT be sold. They must NOT be redistributed if you modify them. VCE IT THEORY SLIDESHOWS