Expression. Arithmetic Operators +, -, *, /, ^, ( ) Evaluating an expression –Examples: 4 + 2 – 1 4 + 2 * 3 3 – 4 / 2 8 / 4 * 2 2 * 3 ^ 2 (2 * 3) + 2.

Slides:



Advertisements
Similar presentations
Computer Codes Rohit Khokher. Computer Codes Data types NumericNonnumeric IntegerRealAlphabet A, B, C, …,Z a, b, c,…,z Digits 0,…,9 Special Characters.
Advertisements

The Binary Numbering Systems
Introduction to Computers and Programming Lecture 7:
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 9: Characters * Character primitives * Character Wrapper class.
Using Binary Coding Information Remember  Bit = 0 or 1, Binary Digit  Byte = the number of bits used to represent letters, numbers and special characters.
Review Binary –Each digit place is a power of 2 –Any two state phenomenon can encode a binary number –The number of bits (digits) required directly relates.
Working with the data type: char  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course. Introduction to Computers and Programming.
Data Representation CS105. Data Representation Types of data: – Numbers – Text – Audio – Images & Graphics – Video.
Primitive Types CSE 115 Spring 2006 April 3 &
Data Representation (in computer system) Computer Fundamental CIM2460 Bavy LI.
CODING SYSTEMS CODING SYSTEMS CODING SYSTEMS. CHARACTERS CHARACTERS digits: 0 – 9 (numeric characters) letters: alphabetic characters punctuation marks:
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
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:
©Brooks/Cole, 2003 Chapter 2 Data Representation.
Chapter 2 Data Representation. Define data types. Visualize how data are stored inside a computer. Understand the differences between text, numbers, images,
Chapter 2: C Fundamentals Dr. Ameer Ali. Overview C Character set Identifiers and Keywords Data Types Constants Variables and Arrays Declarations Expressions.
Chapter 3 Representing Numbers and Text in Binary Information Technology in Theory By Pelin Aksoy and Laura DeNardis.
Representing text Each of different symbol on the text (alphabet letter) is assigned a unique bit patterns the text is then representing as.
Bits & Bytes: How Computers Represent 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:
Aloha Aloha What you see: What the computer sees: binary number columns binary number columns
Working with text ASCII and UNICODE.   
Lecture # 5 Data Representation. Today Questions: From notes/reading/life? Prepare for Quiz # 1 (Multiple Choice) 1.Introduce: How do Computers store.
Binary Arithmetic & Data representation
Information and Programs. Foundations of Computing Information –Binary numbers –Integers and Floating Point –Booleans (True, False) –Characters –Variables.
Primitive Variables.
Section 3.1: Number Representation Practice HW (not to hand in) From Barr Text p. 185 # 1-5.
Representing Characters in a computer Pressing a key on the computer a code is generated that the computer can convert into a symbol for displaying or.
The character data type char. Character type char is used to represent alpha-numerical information (characters) inside the computer uses 2 bytes of memory.
Data as the computer sees it 1.  Number systems Number systems  Data storage Data storage  Glossary Glossary 2.
Representation of Characters
Java Programming, Second Edition Chapter Two Using Data Within a Program.
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 2A Reading, Processing and Displaying Data (Concepts)
CPS120: Introduction to Computer Science Variables and Constants.
1 Problem Solving using Computers “Data....Representation, and Storage.
Data Representation. How is data stored on a computer? Registers, main memory, etc. consists of grids of transistors Transistors are in one of two states,
C BASICS QUIZ (DATA TYPES & OPERATORS). C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards.
Representing Characters in a Computer System Representation of Data in Computer Systems.
Information Coding Schemes Group Member : Yvonne Tiffany Jurifah bt Junaidi Clara Jane George.
Nguyen Le CS147.  2.4 Signed Integer Representation  – Signed Magnitude  – Complement Systems  – Unsigned Versus Signed Numbers.
CS 101 – Sept. 11 Review linear vs. non-linear representations. Text representation Compression techniques Image representation –grayscale –File size issues.
Understanding Computers
THE CODING SYSTEM FOR REPRESENTING DATA IN COMPUTER.
1.4 Representation of data in computer systems Character.
Lecture Coding Schemes. Representing Data English language uses 26 symbols to represent an idea Different sets of bit patterns have been designed to represent.
Nat 4/5 Computing Science Data Representation Lesson 3: Storing Text
Text and Images Key Revision Points.
Understanding binary Understanding Computers.
Binary 1 Basic conversions.
Binary
Data Transfer ASCII FILES.
ITEC113 Algorithms and Programming Techniques
EPSII 59:006 Spring 2004.
Data Encoding Characters.
TOPICS Information Representation Characters and Images
Representing Nonnumeric Data
COMS 161 Introduction to Computing
Chapter 2 Data Representation.
COMS 161 Introduction to Computing
Plan Attendance Files Posted on Campus Cruiser Homework Reminder
How Computers Store Data
Data Representation Chapter 2 Computer HW (Von Neumann Model) Program
Learning Intention I will learn how computers store text.
The Data Element.
The Data Element.
Electronic Memory.
WJEC GCSE Computer Science
Lecture 36 – Unit 6 – Under the Hood Binary Encoding – Part 2
ASCII and Unicode.
Presentation transcript:

Expression

Arithmetic Operators +, -, *, /, ^, ( ) Evaluating an expression –Examples: – * 3 3 – 4 / 2 8 / 4 * 2 2 * 3 ^ 2 (2 * 3) + 2 ^ 3

Order of Evaluation OperatorMultiples 1 ( )Inner to outer, left to right 2. ^left to right 3. *, /left to right 4. +, -left to right

Formula to Expression

((A+B))*2

Expression to Formula A / B * C - 2 A + B * C ^ D (A + B / (C – 2)) ^ D + 1 Evaluating an expression: 4 * / 4 * 2 ^ 2 – 1 18 / 3 ^ 2 * (1 + 2)

Example Note: PV = f (FutureValue, IntRate, Years) Independent variables, dependent variable

Text Operator Concatenation: & –Join two or more text values into a single text value.

Number and Text Are Not Compatible ‘1 is different from 1. #VALUE –Blank and space are different.

Data Representation Digitizing: –Data, image, video, music –Digital smell Binary digit: Bit –0, 1

Text Data Text (Character, String) –Letters, digits, other symbols Coding schemes: –ASCII: 8 bits (byte), 256 characters “1” : The code for “A” is different from “a”. –EBCDIC: 8 bits –UniCode: 16 bits, characters

Numeric Data Integer: Binary number 1: Real: Floating number > * 10^3

Case Sensitive/Insensitive Many computer systems are case sensitive: –Operating systems: Unix, Linux –Programming languages: Java, C++, C# –Database: XML –Demo: Telnet:libra.sfsu.edu Username, Password

Comparing Text Data Collating sequence: the ordering of characters: –Blank –Digits in numerical order –Upper case letters in alphabetical order –Lower case letters in alphabetical order To compare two texts: –From left to right –Character for character

Examples “JEAN” < “JOHN”:True/False “John” < “Johny”:True/False “1234” < “45”:True/False Arrange “alan”, “Chao”, “JOHN” in ascending order: Arrange P1, P3, P10, P15, P20 in ascending order: Oracle database demo: Telnet: libra.sfsu.edu –Select * from Cust; –Select * from Cust Order by Cname;

Excel is Case Insensitive Order: –Blank –Digits in numerical order –Letters in alphabetical order Data/Sort/Options/Case Sensitive: –a<A<b<B<c<C …..