Variables. Some Rules of Variable Naming Convention : Variable names are case-sensitive. A variable’s name can be any legal identifier. It can contain.

Slides:



Advertisements
Similar presentations
C++ Basics Variables, Identifiers, Assignments, Input/Output.
Advertisements

Objective: Dealing with data in C++ Agenda: Notes Essay Help.
Constants and Data Types Constants Data Types Reading for this class: L&L,
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
1 Lecture 3  Lexical elements  Some operators:  /, %, =, +=, ++, --  precedence and associativity  #define  Readings: Chapter 2 Section 1 to 10.
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Java Building Elements Lecture 2 Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University
Variables and Data Types
Primitive Data Types and Operations Identifiers, Variables, and Constants Primitive Data Types Byte, short, int, long, float, double, char, boolean Casting.
Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example  The MyInput class F Identifiers, Variables, and Constants F Primitive.
1 Chapter 2 Primitive Data Types and Operations F Introduce Programming with an Example  The MyInput class F Identifiers, Variables, and Constants F Primitive.
The C Character Set: The Characters used to form words, numbers and Expression depends upon the computer on which program runs. Letters. Digits White spaces.
C Tokens Identifiers Keywords Constants Operators Special symbols.
© 2006 Pearson Education 1 Obj: cont 1.3 and 1.4, to become familiar with identifiers and to understand how programming languages work HW: p.51 #1.8 –
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
CPS120: Introduction to Computer Science
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
Primitive Variables.
Module 1.2 Verilog Simulator.  A Verilog program for a particular application consists of two blocks : ◦ Design Block (Module) ◦ Testing Block (Stimulus.
Java Programming: From Problem Analysis to Program Design, 4e Chapter 2 Basic Elements of Java.
Chapter 2 Using Objects. Types A type defines a set of values and the operations that can be carried out on the values Examples: 13 has type int "Hello,
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Recognizing PL/SQL Lexical Units. 2 home back first prev next last What Will I Learn? List and define the different types of lexical units available in.
Java Overview. Comments in a Java Program Comments can be single line comments like C++ Example: //This is a Java Comment Comments can be spread over.
PHY-102 SAPVariables and OperatorsSlide 1 Variables and Operators In this section we will learn how about variables in Java and basic operations one can.
Primitive Variables.
Identifiers.
Copyright Curt Hill Variables What are they? Why do we need them?
Variables and control statements in PL\SQL Chapter 10.
© 2011 Pearson Education, publishing as Addison-Wesley Tuesday After answering the questions after logging in, open BlueJ and the Formula class.
Coding Conventions  Coding conventions are a set of guidelines for a specific software project that recommend programming style, practices and methods.
Variables and Constants Objectives F To understand Identifiers, Variables, and Constants.
Data And Variables Chapter Names vs. Values Michael Jordan name (the letter sequence used to refer to something) value (the thing itself)
Ajmer Singh PGT(IP) Programming Fundamentals. Ajmer Singh PGT(IP) Java Character Set Character set is a set of valid characters that a language can recognize.
Variables 1. What is a variable? Something whose value can change over time This value can change more than once over the time period (no limit!) Example:
Developed at Sun Microsystems in 1991 James Gosling, initially named “OAK” Formally announced java in 1995 Object oriented and cant write procedural.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
Introduction ABAP Fields and Variables. Slide 2 Fields (Introduction) In ABAP, fields (or data objects) are named locations in memory Variables store.
1 09/03/04CS150 Introduction to Computer Science 1 What Data Do We Have.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
Chapter 5. Outline Some Exercises in C++ Names Variables Scope Lifetime.
Variables Variables:-
JavaScript Variables Like other programming languages, JavaScript variables are a container that contains a value - a value that can be changed/fixed.
JavaScript Variables. Definition A variable is a "container" for information you want to store. A variable's value can change during the script.
Parts of an Expression. TERMS Each expression is made up of terms. A term can be a signed number, a variable, or a constant multiplied by a variable or.
WELL- FORMEDNESS CH 6. Objective Well-formedness rules Text in XML Elements and Tags in Atributes Entity references CDATA sections Comments Unicode XML1.1.
Java Variables and Types
Chapter 3 GC 101 Java Fundamentals.
Lecture 2 Data Types Richard Gesick.
University of Central Florida COP 3330 Object Oriented Programming
trigraph ??= is for # ??( is for [ ??< is for { ??! is for |
C-Character Set Dept. of Computer Applications Prof. Harpreet Kaur
Identifying the Parts of an Expression
Java Programming: From Problem Analysis to Program Design, 4e
Unit-1 Introduction to Java
Divisibility Rules.
Divisibility Rules.
Divisibility Rules.
The Linux Command Line Chapter 25
Chap 2. Identifiers, Keywords, and Types
Use a variable to store a value that you want to use at a later time
Chapter 2 Primitive Data Types and Operations
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
Basic Programming Lab C.
Introduction to MATLAB
Presentation transcript:

Variables

Some Rules of Variable Naming Convention : Variable names are case-sensitive. A variable’s name can be any legal identifier. It can contain Unicode letter,Digits and Two Special Characters such as Underscore and dollar Sign. Length of Variable name can be any number.

Some Rules of Variable Naming Convention : Its necessary to use Alphabet at the start (however we can use underscore, but do not use it ) Some auto generated variables may contain ‘$‘ sign. But try to avoid using Dollar Sign. White space is not permitted. Special Characters at start are not allowed. Digit at start is not allowed. Subsequent characters may be letters, digits, dollar signs, or underscore characters. Variable name must not be a keyword or reserved word.

Some Standard Conventions Used : 1. Never Use Dollar Or Underscore as First Letter Dollar Sign and Underscore as First Character in Variable name is allowed but still its not good programming Style to use it as First Character. Generally we use Underscore in “Constant Value” variable. String TOTAL_NUM = ten; String MAX_COUNT = twenty;

2. Capitalization of First Character of Second Word If variable name contain two words then write first letter of second word in Capital Case. If variable name contain single word then write that word in small case. Example : Multiple Words in Variable Name – sumOfNumber – firstNumber – skinColor Example : Single Word in Variable Name – sum – First – last

Valid Variable names? i an_apple numberOfMonkeysThatFitInABarrel $floater harry03