GoConqr has a new look! Let us know what you think.

Slides

Unit 2 - Data Basics: Variables

mamoun diab English 5 slides

Slides in this set (5)

  1. Definitions

    • Variable: is a named memory location which temporarily stores dat that can change while the program is running.\\
    • Final: is named memory location which temporarily stores data that remains the same throughout the execution of the program.
    • Type: indicate what kind of value it will store.
    • The name of the variable is know as its identifier.
    • A variable is given a value through an assignment statement.
  2. Rules for assigning variables

    • Assign short, int or long data when a variable is whole number
    • Assign float or double when decimals are needed.
    • Assign char if the variable will always contain only one character.
  3. Rules for naming variables

    • All variable names must begin with a letter of an alphabet, underscore _ OR $
    • Variables names may alsos contain letters and and th digits 0 to 9 no spaces
    • Uppercase characters are distinct from lowercase characters. Using ALL are primarily used to identify constant variables
  4. All Variables must be declared before they can be used

    • Choose the type you need
    • Choose name for variable
    • use the following format for a declaration statement.
    • you may declare more than one variable.
    • you may initialize a variable
  5. Slide 5

Information

Description
Slide Set on Unit 2 - Data Basics: Variables, created by mamoun diab on 25/02/2017.
Created by
mamoun diab · Feb 2017
Updated
Mar 2, 2017
Views
10
Rating

More on Variables, Constants and Data Types

Feedback

What is it about?

What do you think of the new look?

How do you like it?