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.

Slides:



Advertisements
Similar presentations
This Time Whitespace and Input/Output revisited The Programming cycle Boolean Operators The “if” control structure LAB –Write a program that takes an integer.
Advertisements

Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Constants and Data Types Constants Data Types Reading for this class: L&L,
Types and Variables. Computer Programming 2 C++ in one page!
1 Lexical Elements Chapter 2 in ABC. 2 Tokens Token = word / symbol, does not contain white spaces. Tokens in C are either: –keywords –identifiers –constants.
Data types and variables
The Fundamentals of C++ Basic programming elements and concepts JPC and JWD © 2002 McGraw-Hill, Inc.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
Chapter 2 Data Types, Declarations, and Displays
1 Lecture 3  Lexical elements  Some operators:  /, %, =, +=, ++, --  precedence and associativity  #define  Readings: Chapter 2 Section 1 to 10.
Variable & Constants. A variable is a name given to a storage area that our programs can manipulate. Each variable in C has a specific type, which determines.
Objectives You should be able to describe: Data Types
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Chapter 2: C Fundamentals Dr. Ameer Ali. Overview C Character set Identifiers and Keywords Data Types Constants Variables and Arrays Declarations Expressions.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
2440: 211 Interactive Web Programming Expressions & Operators.
System development with Java Lecture 2. Rina Errors A program can have three types of errors: Syntax and semantic errors – called.
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
Constants in C A Presentation On Department of Computer & Information Technology, M.S.P.V.L. Polytechnic College, Pavoorchatram.
1 Do you have a CS account? Primitive types –“ building blocks ” for more complicated types Java is strongly typed –All variables in a Java program must.
Input, Output, and Processing
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 2. C++ Program Structure C++ program is a collection of subprograms Subprograms in C++ are called FUNCTIONS Each function performs a specific.
The Fundamentals of C++ Chapter 2: Basic programming elements and concepts JPC and JWD © 2002 McGraw-Hill, Inc. Modified by S. Sudarshan.
C++ Character Set It is set of Characters/digits/symbol which is valid in C++. Example – A-Z, (white space) C++ Character Set It is set of.
Characters and tokens Characters are the basic building blocks in C program, equivalent to ‘letters’ in English language Includes every printable character.
Module 1.2 Verilog Simulator.  A Verilog program for a particular application consists of two blocks : ◦ Design Block (Module) ◦ Testing Block (Stimulus.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
 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.
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
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.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
Copyright Curt Hill Variables What are they? Why do we need them?
1 COMS 261 Computer Science I Title: C++ Fundamentals Date: September 9, 2005 Lecture Number: 6.
Chapter 4 Literals, Variables and Constants. #Page2 4.1 Literals Any numeric literal starting with 0x specifies that the following is a hexadecimal value.
Topics to be covered  Introduction to C Introduction to C  Characterstics of C Characterstics of C  Characterset Characterset  Keywords Keywords 
1 Comments Allow prose or commentary to be included in program Importance Programs are read far more often than they are written Programs need to be understood.
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.
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
Introduction C# program is collection of classes Classes are collection of methods and some statements That statements contains tokens C# includes five.
CSE 110: Programming Language I Matin Saad Abdullah UB 1222.
Basics of ‘ C ’ By Gaikwad Varsha P. Asst. Prof. Information Technology Dept. Govt. College of Engg. Aurangabad.
Java Programming: Guided Learning with Early Objects Chapter 1 Basic Elements of Java.
Topics Designing a Program Input, Processing, and Output
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Java Variables and Types
BASIC ELEMENTS OF A COMPUTER PROGRAM
Documentation Need to have documentation in all programs
Wel come.
Variables and Primative Types
Introduction to C++.
INTRODUCTION c is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. Most of the programs.
C++ Basics.
Basics of ‘C’.
Chapter 2: Introduction to C++.
Topics Designing a Program Input, Processing, and Output
Topics Designing a Program Input, Processing, and Output
Primitive Types and Expressions
Chap 2. Identifiers, Keywords, and Types
Lexical Elements & Operators
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
The Fundamentals of C++
Programming Fundamental-1
Basic Java structural components
PYTHON - VARIABLES AND OPERATORS
Presentation transcript:

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. A character represents any letter, digit, or any other sign. Java uses the Unicode character set. Letters :- A-Z, a-z Digits :- 0-9 Special Symbols :- Space + - * / ^ \ ( ) [ ] { } = !=. ‘ “ $, ; : % ! & ? _(underscore) # White Spaces :- Blank spaces, Horizontal tab, Carriage return, New line, Form feed.

Tokens(Lexical units) The smallest individual unit in a program is known as a Token or lexical unit. Types of Tokens :- Keywords Identifiers Literals Punctuators Operators

Keywords Keywords are the words that convey a special meaning to the language compiler. These are reserved for special purpose and must not be used as normal identifier names. E.g if, else, int, float, etc.

Identifiers Identifiers are names given to different part of the program by user. Rules to write identifiers :- 1. They must not begin with digits. 2. No special symbols are used except _(underscore) and $ (dollar sign) character 3. They must not be a keyword. 4. Java is case sensitive language. Upper case and lower case letters are treated differently. Examples:- myfile, date9_2_7_6

Literals Literals (literals) are data items that are fixed data values. Types of Literals :- 1. Integer literal 2. Floating literal 3. Character literal 4. String literal 5. Boolean literal 6. Null literal

Integer Literal Integer literals are whole numbers without any fractional part. Three types of Integer literals :- 1. Decimal Integer literal 2. Octal Integer literal 3. Hexadecimal Integer literal

Decimal Integer literal An integer literal consisting of a sequence of digits is taken to be decimal integer literal unless it begins with 0 (digit zero). Example:- 1296, 5642, 12, +69,- 23,etc.,

Octal Integer literal A sequence of digits starting with 0(digit zero) is taken to be an octal integer. Example:-0123, 0456, etc.,

Hexadecimal Integer literal A sequence of digits preceded by 0x or 0X is taken to be an hexadecimal integer. Example:- 0x4B6, 0XA43,etc.,

Floating literals Floating literals are also called as Real literals Real literals are numbers having fractional parts. These may be written in one of the two forms called fractional form or the exponent form. Examples:-2.0, 3.5, 8.6, etc.,

Character literals A Character literal is one character enclosed in single quotes, as in ‘z’. Examples:- ‘a’, ‘b’, etc.,

String Literals String literal is a sequence of zero or more characters surrounded by double quotes(“ ”). Examples:-”a”, “ade”, etc.,

Ajmer Singh PGT(IP) Punctuators or Separators The following characters are used as punctuators. [ ] ( ) { }, ;.

Ajmer Singh PGT(IP) Operators Operators are symbols that perform some action. E.g +, -, /, * etc.