COMPUTING.

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

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.
Chapter 4 Control Structures I. Objectives ► Examine relational and logical operators ► Explore how to form and evaluate logical (Boolean) expressions.
Program Design and Development
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:
Adapted from slides by Marie desJardins
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Outline Variables 1.
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
Mr C Johnston ICT Teacher BTEC IT Unit 06 - Lesson 05 Learning To Program.
Introduction to Python
Algorithmic Problem Solving CMSC 201 Adapted from slides by Marie desJardins (Spring 2015 Prof Chang version)
Walk through previous lecture. TSP Questions: How many tours are there? How do you solve it? How fast can you solve it?
2440: 211 Interactive Web Programming Expressions & Operators.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Tutorial 6 Introducing Variables, Memory Concepts & Arithmetic.
Lesson 2.3 Real Zeros of Polynomials. The Division Algorithm.
INFORMATION TECHNOLOGY CSEC CXC 10/25/ PASCAL is a programming language named after the 17th century mathematician Blaise Pascal. Pascal provides.
David Stotts Computer Science Department UNC Chapel Hill.
Python Conditionals chapter 5
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.
Repetition. Loops Allows the same set of instructions to be used over and over again Starts with the keyword loop and ends with end loop. This will create.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Arithmetic Expressions Addition (+) Subtraction (-) Multiplication (*) Division (/) –Integer –Real Number Mod Operator (%) Same as regular Depends on the.
3 Basics © 2010 David A Watt, University of Glasgow Accelerated Programming 2 Part I: Python Programming.
1 CS 177 Week 6 Recitation Slides Review for Midterm Exam.
Tutorial 9 Iteration. Reminder Assignment 8 is due Wednesday.
Expressions and Order of Operations Operators – There are the standard operators: add, subtract, divide, multiply – Note that * means multiply? (No times.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
What is Binary Code? Computers use a special code of their own to express the digital information they process. It's called the binary code because it.
PROGRAMMING INFORMATION. PROCEDURES IN PYTHON Procedures can make code shorter, simpler, and easier to write. If you wanted, for example, to use a certain.
Java for Beginners University Greenwich Computing At School DASCO
Java String Methods - Codehs
7 - Programming 7J, K, L, M, N, O – Handling Data.
CMSC201 Computer Science I for Majors Lecture 03 – Operators
Chapter 2 Variables.
Chapter 2 Basic Computation
IGCSE 1 Cambridge Algorithms and flowcharts Unit 7 Computer Science
Operators Operators are symbols such as + (addition), - (subtraction), and * (multiplication). Operators do something with values. $foo = 25; $foo – 15;
Data Structures and Algorithms
Basic operators - strings
Computer Science 3 Hobart College
Selection CIS 40 – Introduction to Programming in Python
CSCI206 - Computer Organization & Programming
Arithmetic operations, decisions and looping
Examples of Primitive Values
Chapter 2 Variables.
More Maths Programming Guides.
Computer Science Core Concepts
COM-152: Computer Programming Types, Variables, Operators Part 1 of 2
Algorithms computer as the tool process – algorithm
Operations Python code.
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.
Python Basics with Jupyter Notebook
The structure of programming
The Data Element.
Fundamental OOP Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
In this class, we will cover:
Understanding Code Workshop 2.
The Data Element.
Chapter 2 Variables.
design OO words Debug Variables Data types
5.03 Apply operators and Boolean expressions
Hardware is… Software is…
Challenge Guide Grade Code Type Slides
Programming Techniques
Python Creating a calculator.
Presentation transcript:

COMPUTING

2.2 Programming Techniques Python Code: variable/constant=input(“string”) print(variable/constant + “string”) if variable/constant (comparison e.g. ==) value: elif variable/constant <= value: else: for i in range (0,5): while variable == condition: Declaration: Identifying a variable or constant so that a suitable memory location can be assigned to it. Constant: data value is set when declared Variable: data value is set while program is running Data Types: real numbers (10.1) integer (10) string (hello!1) char (a) boolean (TRUE) Casting: changing a variable from one data type to another Programming Constructs: Sequence – an algorithm putting instructions in order (INPUT, OUTPUT and calculation) Selection – an algorithm with a decision or choice (IF, ELSE, END IF) Iteration – an algorithm with a loop (FOR, END FOR, REPEAT, END REPEAT, WHILE, END WHILE)

2.2 Programming Techniques Functions: add (+) subtract (-) multiply (*) divide (/) to the power of (**) e.g. 42 = 4**2 DIV or // (Quotient): division giving the answer as an integer, ignoring the remainder e.g. 14/3 = 4 rem 2 MOD or % (Modulus): finds the remainder, of a division e.g. 14/3=4 rem 2 Assignment: one = sets the value of a constant/variable (e.g. total = 10 – makes the variable total be equal to the value 10) Comparison: equal to == not equal to <> or != less than < and less than or equal to <= greater than > and greater than or equal to >= Boolean operators: AND (e.g. 3<5 AND 2>1), OR (e.g. 1>8 OR 2==2), NOT(10>6) – these will return a TRUE or FALSE result String manipulation: string.len = returns the length, string+string = concatenates two strings, string.upper/string.lower = upper and lowercase