The Data Element.

Slides:



Advertisements
Similar presentations
CSci 1130 Intro to Programming in Java
Advertisements

Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Chapter 3 DATA: TYPES, CLASSES, AND OBJECTS. Chapter 3 Data Abstraction Abstract data types allow you to work with data without concern for how the data.
Introduction to Computing Concepts Note Set 7. Overview Variables Data Types Basic Arithmetic Expressions ▫ Arithmetic.
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,
Slides prepared by Rose Williams, Binghamton University Chapter 3 Flow of Control if-else and switch statements.
High-Level Programming Languages
Chapter 8 High-Level Programming Languages Nell Dale John Lewis.
Data types and variables
Primitive Types Java supports two kinds of types of values – objects, and – values of primitive data types variables store – either references to objects.
JavaScript, Fourth Edition
Chapter 2 Data Types, Declarations, and Displays
JavaScript, Third Edition
1 MATERI PENDUKUNG OPERATOR Matakuliah: M0074/PROGRAMMING II Tahun: 2005 Versi: 1/0.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.3 The Class String.
String Escape Sequences
Identifiers and Assignment Statements. Data structures In any programming language you need to refer to data The simplest way is with the actual data.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
1 Variables, Constants, and Data Types Primitive Data Types Variables, Initialization, and Assignment Constants Characters Strings Reading for this class:
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
CSCI 1100/1202 January 16, Why do we need variables? To store intermediate results in a long computation. To store a value that is used more than.
Lesson 2 McManus COP  Computational ◦ problems involving some kind of mathematical processing  Logical ◦ Problems involving relational or logical.
The Data Element. 2 Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing:
2440: 211 Interactive Web Programming Expressions & Operators.
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 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
Operators & Identifiers The Data Elements. Arithmetic Operators exponentiation multiplication division ( real ) division ( integer quotient ) division.
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Assignment An assignment statement changes the value of a variable The assignment operator is the = sign total = 55; Copyright © 2012 Pearson Education,
1 homework Due today: hw #1 (mailing list printout) readings to date: chapter 1 and chapter read appendix B (3 pages on DOS) and and.
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
Java Language Basics By Keywords Keywords of Java are given below – abstract continue for new switch assert *** default goto * package.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
Chapter 3 Boolean Expressions Section 3.2 Slides prepared by Rose Williams, Binghamton University Kenrick Mock, University of Alaska Anchorage.
Programming in Java (COP 2250) Lecture 4 Chengyong Yang Fall, 2005.
CPS120: Introduction to Computer Science Variables and Constants.
CHAPTER 2 PROBLEM SOLVING USING C++ 1 C++ Programming PEG200/Saidatul Rahah.
C BASICS QUIZ (DATA TYPES & OPERATORS). C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards.
Primitive Data Types 1 In PowerPoint, point at the speaker icon, then click the "Play" button.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Chapter 4: Variables, Constants, and Arithmetic Operators Introduction to Programming with C++ Fourth Edition.
Design A software design specifies how a program will accomplish its requirements A design includes one or more algorithms to accomplish its goal.
 Type Called bool  Bool has only two possible values: True and False.
© 2004 Pearson Addison-Wesley. All rights reserved August 27, 2007 Primitive Data Types ComS 207: Programming I (in Java) Iowa State University, FALL 2007.
Java Variables and Types
BASIC ELEMENTS OF A COMPUTER PROGRAM
Primitive Data Types August 28, 2006 ComS 207: Programming I (in Java)
Object Oriented Programming
Data Types, Identifiers, and Expressions
Multiple variables can be created in one declaration
Data Types, Identifiers, and Expressions
Basics of ‘C’.
Chapter 2: Java Fundamentals
High Level Programming Languages
Low Level Programming Languages
Chapter 2: Java Fundamentals
Relational Operators.
Chap 2. Identifiers, Keywords, and Types
The Data Element.
Chapter 2 Primitive Data Types and Operations
Review of Java Fundamentals
Programming Fundamental-1
3.0 - Design A software design specifies how a program will accomplish its requirements A design includes one or more algorithms to accomplish its goal.
Presentation transcript:

The Data Element

The Data Element Data type: A description of the set of values and the basic set of operations that can be applied to values of the type. Strong typing: The requirement that only a value of the proper type can be stored into a variable.

Data Types Integer numbers Real numbers Characters Boolean values Strings

Data Types: Integers The range varies depending upon how many bytes are assigned to represent an integer value. Some high-level languages provide several integer types of different sizes. Operations that can be applied to integers are the standard arithmetic and relational operations.

Data Types: Reals Like the integer data type, the range varies depending on the number of bytes assigned to represent a real number. Many high-level languages have two sizes of real numbers. The operations that can be applied to real numbers are the same as those that can be applied to integer numbers.

Data Types: Characters It takes one byte to represent characters in the ASCII character set. Two bytes represent each character in the Unicode character set. The English alphabet is represented in ASCII, which is a subset of Unicode.

Data Types: Characters Applying arithmetic operations to characters does not make much sense. Comparing characters does make sense, so the relational operators can be applied to characters. The meanings of “less than” and “greater than” when applied to characters are “comes before” and “comes after” in the character set.

Data Types: Boolean The Boolean data type consists of two values: true and false. Not all high-level languages support the Boolean data type.

Data Types: Strings A string is a sequence of characters considered as one data value. For example: “This is a string.” Contains 17 characters: one uppercase letter, 12 lowercase letters, three blanks, and a dot. The operations defined on strings vary from language to language. They include concatenation of strings and comparison of strings in terms of lexicographic order.

Declarations Declaration: A statement that associates an identifier with a variable, an action, or some other entity within the language that can be given a name. The programmer can then refer to that item by its name.

Declarations Reserved word: A word in a language that has special meaning. These words CANNOT be declared to be anything else. Some languages are NOT case-sensitive: UPPERCASE and lowercase letters are considered the same.

Assignment statement Assignment statement: An action statement (not a declaration) that says to evaluate the expression on the right-hand side of the symbol and store that value into the place named on the left-hand side. Most manipulation of data occurs in assignments.