Friday, 31 January 2014

3.1.1 Data Types

Integer:  Whole positive or negative numbers
1,2,3,4,5,6,0,-1,-2,-3,-4,-5,-6 etc

Real/Floating point number: Decimal numbers are Used for times, measurements.  Floats are accurate but slow.

Date/Time: Used to store dates and times

e.g 11/06/2012/ 20.10pm

String: Strings are sequences of characters that can contain numbers, special characters and letters.

Variables in a computer program can be thought of as "Buckets" or "Envelopes" where information can be stored in computer memory

find out here

3.1.1 The purpose of data types within code

Data can be stored in many different forms
Programming languages use different data types to make best use of space.  E.g. Floats take up more room than integers

E.g. You cannot multiply 2 strings together, or get the last character of an integer

Friday, 24 January 2014

3.1.1 Naming Variables

Variable

A variable can be as short as a single letter but cannot be a number.After the first character, a variable name can include letters, numbers and underscores in any combination
The name of a variable cannot be one of the words that the programming language has reserved.  E.g. print, if, while etc.

A good variable name is specific to the information being stored.  E.g. firstName

3.1.1 The Difference between a variable and a constant

What Is The Difference between a variable and a constant?

Variable:

If you declare a variable in C later on we talk about how to do this, you ask the operating system for a piece of memory. This piece of memory you give a name and you can store something in that piece of memory for later use.


Constant:

The difference between variables and constants is that variables can change their value at any time but constants can never change their value.


Read more about constants and variables:

Thursday, 23 January 2014

3.1.1 Data And Information

What is the difference between Data and information?


Data:
Data is facts or statistics out of a context. so data is meaningless if it is on its own.
E.g. characters, numbers, images and symbols . they are all some sorts of data. 
Data are the facts of the World raw information. Data is normally stored in a database or a file. 

Information

When data is processed, organized or presented in a given context to make it useful, it is called Information.







Click here to see more: