Chapter One Lesson Three DATA TYPES © www.waxkabaro.com.

Slides:



Advertisements
Similar presentations
Procedural Programming in C# Chapters Objectives You will be able to: Describe the most important data types available in C#. Read numeric values.
Advertisements

STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
 Base “primitive” types: TypeDescriptionSize intThe integer type, with range -2,147,483, ,147,483,647 4 bytes byteThe type describing a single.
C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
10-Jun-15 Introduction to Primitives. 2 Overview Today we will discuss: The eight primitive types, especially int and double Declaring the types of variables.
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
ECP4136 Java Technology Tutorial 2. Overview Replacement class? Previous tutorials What you’ve learnt Tasks for this tutorial session.
Primitive Types CSE 115 Spring 2006 April 3 &
Lecture 2: Topics Bits and Bytes Primitive Types Casting Strings Boolean expressions.
Integer, Floating-Point, Text Data, Variables, Literals Svetlin Nakov Telerik Corporation
Programming Principles Data types and Variables. Data types Variables are nothing but reserved memory locations to store values. This means that when.
Introduction to Classes and Objects (Through Ch 5) Dr. John P. Abraham Professor UTPA.
1 Number Types  Every value in Java is either: 1.a reference to an object or 2.one of the eight primitive types  eight primitive types: a.four integer.
1 The CONST definition CONST Pi = , City = ‘New York’; Constant identifiers are used when you do not want the value of an identifier to change why.
C Tokens Identifiers Keywords Constants Operators Special symbols.
CSCI 3328 Object Oriented Programming in C# Chapter 3: Introduction to Classes and Objects UTPA – Fall
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 3A Integral Data (Concepts)
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Lecture #5 Introduction to C++
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
BUILDING JAVA PROGRAMS CHAPTER 2 PRIMITIVE DATA TYPES AND OPERATIONS.
Java Simple Types CSIS 3701: Advanced Object Oriented Programming.
Objects, Classes and Syntax Dr. Andrew Wallace PhD BEng(hons) EurIng
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
CS177 Week2: Recitation Primitive data types and Strings with code examples.
Telerik Software Academy Telerik School Academy Integer, Floating-Point, Text Data, Variables,
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Programming with Visual C++: Concepts and Projects Chapter 3A: Integral Data (Concepts)
Java Language Basics By Keywords Keywords of Java are given below – abstract continue for new switch assert *** default goto * package.
Copyright © – Curt Hill Types What they do.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
1 More data types Character and String –Non-numeric variables –Examples: char orange; String something; –orange and something are variable names –Note.
“Great leaders are never satisfied with current levels of performance. They are restlessly driven by possibilities and potential achievements.” – Donna.
© A+ Computer Science - A reference variable stores the memory address of an object. Monster fred = new Monster(); Monster sally.
CSM-Java Programming-I Spring,2005 Fundamental Data Types Lesson - 2.
1.2 Primitive Data Types and Variables
Numbers1 Working with Numbers There are times that we have to work with numerical values. When we count things, we need Integers or whole numbers. When.
A: A: double “4” A: “34” 4.
CSCI S-1 Section 4. Deadlines for Homework 2 Problems 1-8 in Parts C and D – Friday, July 3, 17:00 EST Parts E and F – Tuesday, July 7, 17:00 EST.
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.
COP2800 – Computer Programming Using JAVA University of Florida Department of CISE Spring 2013 Lecture 06 – Java Datatypes Webpage:
 Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. 
Floating Point ValuestMyn1 Floating Point Values Internally, floating point numbers have three pairs: a sign (positive or negative), a mantissa (has a.
A data type in a programming language is a set of data with values having predefined characteristics.data The language usually specifies:  the range.
Computer Programs CS 1400 Dennis A. Fairclough Version 1.1 CS 1400 Dennis A. Fairclough Version 1.1.
Data Types References:  Data Type:  In computer science and computer programming, a data type or simply type is a.
Primitive Data Types. int This is the type you are familiar with and have been using Stores an integer value (whole number) between -2,147,483,648 (-2.
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Basic Data Types อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 4.
CSE 110: Programming Language I Matin Saad Abdullah UB 1222.
Lecture 3: More Java Basics Michael Hsu CSULA. Recall From Lecture Two  Write a basic program in Java  The process of writing, compiling, and running.
Review by Mr. Maasz, Summary of Chapter 2: Starting Out with Java.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Fundamentals 2.
Variable Declarations
Chapter 2.
IDENTIFIERS CSC 111.
Review Operation Bingo
Unit-2 Objects and Classes
Computers & Programming Languages
An Introduction to Java – Part I, language basics
C++ Data Types Data Type
Chapter 2: Java Fundamentals
Data Types Imran Rashid CTO at ManiWeber Technologies.
class PrintOnetoTen { public static void main(String args[]) {
B065: PROGRAMMING Variables 1.
Introduction to Primitives
C# Revision Cards Data types
Chapter 3 Introduction to Classes, Objects Methods and Strings
Module 2 Variables, Data Types and Arithmetic
Presentation transcript:

Chapter One Lesson Three DATA TYPES ©

What is Data type? Data types are sets (ranges) of values that have similar characteristics. For instance byte type specifies the set of integers in the range of [0 … 255]. ©

Types Basic data types in C# are distributed into the following types:  - Integer types (Whole Number without Negative) – short(int16), int(int32) long(int64);  - Real floating-point types(Decimal number with or without negative and ) – float, double;  - Real type with decimal precision – decimal;  - Boolean type – bool (True or False);  - Character type – char;  - String – string;  - Object type – object. ©

Integer types- examples { Int16 centuries = 20; Int16 years = 2000; Int32 days = ; Int32 hours = ; Int32 minutes = ; Int64 seconds = ; Int64 milliseconds = ; Console.WriteLine(centuries + " centuries are " + years +" years, or " + days + " days, or " + hours + " hours or " + minutes + " minutes or " + seconds +" seconds or " + milliseconds + " millisoconds "); Console.ReadLine(); } ©

Double Types Double and Decimal types are used for numbers with decimal numbers and negative number Double: It is also called double precision real number and is a 64-bit type with a default value of 0.0d and 0.0D (the suffix 'd' is not mandatory because by default all real numbers in C# are of type double). ©

This type has precision of 15 to 16 decimal digits. The range of values, which can be recorded in double (rounded with precision of significant decimal digits), ©

Decimal type The type of data for real numbers with decimal precision in C# is the 128-bit type decimal. It has a precision from 28 to 29 decimal places. ©

Example – Double Vs Decimal static void Main(string[] args) { int a = 1; int b = 2; decimal PI = m; double pi = ; Console.WriteLine(PI); Console.WriteLine(pi); Console.ReadLine(); } ©

Next Lesson Boolean Type ©