David Stotts Computer Science Department UNC Chapel Hill.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
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.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 4 Making Decisions in a Program.
David Stotts Computer Science Department UNC Chapel Hill.
David Stotts Computer Science Department UNC Chapel Hill.
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
COMP 14 Introduction to Programming Miguel A. Otaduy May 18, 2004.
JavaScript, Third Edition
Geography 465 Assignments, Conditionals, and Loops.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 30, 2005.
David Stotts Computer Science Department UNC Chapel Hill.
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:
VARIABLES, TYPES, INPUT/OUTPUT, ASSIGNMENT OPERATION Shieu-Hong Lin MATH/CS Department Chapel.
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:
CIS Computer Programming Logic
David Stotts Computer Science Department UNC Chapel Hill.
Chapter 3: Data Types and Operators JavaScript - Introductory.
20-753: Fundamentals of Web Programming 1 Lecture 12: Javascript I Fundamentals of Web Programming Lecture 12: Introduction to Javascript.
I Power Int 2 Computing Software Development High Level Language Constructs.
Selection Boolean What is Boolean ? Boolean is a set with only two values : –true –false true and false are standard identifiers in Pascal, called Boolean.
1 Week 2: Variables and Assignment Statements READING: 1.4 – 1.6 EECS Introduction to Computing for the Physical Sciences.
CIS-165 C++ Programming I CIS-165 C++ Programming I Bergen Community College Prof. Faisal Aljamal.
David Stotts Computer Science Department UNC Chapel Hill.
David Stotts Computer Science Department UNC Chapel Hill.
Building Java Programs Primitive Data and Definite Loops.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 6, Lecture 1 (Monday)
David Stotts Computer Science Department UNC Chapel Hill.
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.
ICT Introduction to Programming Chapter 4 – Control Structures I.
ITEC 109 Lecture 7 Operations. Review Variables / Methods Functions Assignments –Purpose? –What provides the data? –What stores the data? –What type of.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Java Review if Online Time For loop Quiz on Thursday.
Higher Computing Software Development -So Far- 5/10/10.
Chapter 14 JavaScript: Part II The Web Warrior Guide to Web Design Technologies.
8. DECISION STRUCTURES Rocky K. C. Chang October 18, 2015 (Adapted from John Zelle’s slides)
Interduction to MATLAB (part 2) Manal Alotaibi Mathematics department College of science King saud university.
Visual Basic Review LBS 126. VB programming Project Form 1Form 2Form 3 Text boxButton Picture box Objects Text box Button Objects.
Knowledge Base. Defining a Variable Dim statement Dim intXX As Integer Public in a Module Public dblNN As Double.
David Stotts Computer Science Department UNC Chapel Hill.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Input, Output and Variables GCSE Computer Science – Python.
7 - Programming 7J, K, L, M, N, O – Handling Data.
CMSC201 Computer Science I for Majors Lecture 05 – Comparison Operators and Boolean (Logical) Operators Prof. Katherine Gibson Based on slides by Shawn.
Basic concepts of C++ Presented by Prof. Satyajit De
CMSC201 Computer Science I for Majors Lecture 03 – Operators
CST 1101 Problem Solving Using Computers
Data Structures and Analysis (COMP 410)
Making Choices with if Statements
Introduction to Computer Science / Procedural – 67130
Primitive Data, Variables, Loops (Maybe)
CMSC201 Computer Science I for Majors Lecture 03 – Operators
3rd prep. – 2nd Term MOE Book Questions.
Computers & Programming Languages
Unary Operators ++ and --
Chapter (3) - Looping Questions.
Programming 2 Decision-Making.
Building Java Programs
Selection Statements.
Data Structures and Analysis (COMP 410)
Computer Science Core Concepts
Conditional Logic Presentation Name Course Name
Language Constructs Construct means to build or put together. Language constructs refers to those parts which make up a high level programming language.
Chapter 2 Programming Basics.
The Data Element.
Relational Operators.
Introduction to Computer Science
The Data Element.
boolean Expressions Relational, Equality, and Logical Operators
COMPUTING.
Presentation transcript:

David Stotts Computer Science Department UNC Chapel Hill

0. data (types, simple information) 1. data storage (variables, assignment) 2. data retrieval (expressions, evaluation) 3. repetition (loops) 4. decision making (conditionals) 5. procedure abstraction (functions) 6. data abstraction (arrays) 7. objects: all-the-above, wrapped up

 We can’t study data storage and retrieval without knowing what “data” is Data the basic symbols and information that a computer manipulates  Data is why we write programs in the first place… we have questions, we want answers  Want information we have (input) turned into new information we need (output)

Input information we have and want a program to work on… we have to get it from the user and make it available to the program, in the computer memory Output the new info we expect the program to produce, to generate, to compute… we have to get it out of the program and back to the user in a form the user can consume and employ I/O is the term we use

computer I/O Cloud, etc.

Number 4, 10, -23, , -414, , , 7.0, e e integers and reals

String “tarheels” “x” “ ” “(919) ” aol.com” “hola ! !” “$ntko # &”

Boolean  true, false (yes, no) are the only values  the basis for “logic”

Number + - / * % 4+5   * 7  – 1.1  2.3 7/2  % 12  5 “mod”

Text + concat substring “abc” + “123”  “abc123” we call this concatenation “abc”.concat(“123”)  “abc123” “tarheels”.substring(3)  “heels” “tarheels”.substring(0,2)  “tar”

Boolean && || ! true && true  true AND true && false  false false && false  false true || false  true OR true || true  true false || false  false !false  true NOT !true  false

Comparisons 5 < 8  true less than 17 <= 3.28  false less than or equal 21.4 > -34  true greater than 1.0 >= 1.1  false greater than or equal 12.3 == 2.8  false equal to 12.3 === 2.8  false equal to (safe) -3 != -3.1  true not equal to -3 !== -3.1  true not equal to (safe)

Comparisons work on strings too “hello” < “world”  true alpha order-ish “bigfoot” > “big”  true “tar” == “tarheels”  false “tar” < “tarheels”  true (it’s shorter) “Upper” != “upper”  true case matters “upper” > “Upper”  true (seems strange) “5” > “4”  true these are not numbers “5” > “40”  true remember… alpha order