Objects Methods and Instantiation. Programming Programming is the act of writing instructions that tell a computer how to do something. This module is.

Slides:



Advertisements
Similar presentations
Driving Test 1 Marking Scheme Focus on five areas to pass driving test 1.
Advertisements

IMAT1604 Visual Web Development. What is an Object Anyway? What is a word? Think about the following word… Shop What springs to mind?
PIIT Computer Science Summer Camp - Alice July 10, 2012 Brenda Parker Computer Science Department MTSU.
ZEIT2301 Design of Information Systems Behavioural Design: State Machines School of Engineering and Information Technology Dr Kathryn Merrick.
ISBN Chapter 3 Describing Syntax and Semantics.
1 Lecture-2 CSIT-120 Spring 2001 Revision of Lecture-1 Introducing Computer Architecture The FOUR Main Elements Fetch-Execute Cycle A Look Under the Hood.
1 Chapter 4 The Fundamentals of VBA, Macros, and Command Bars.
Describing Syntax and Semantics
Chapter 1 Program Design
STORYTELLING EXPERIENCES ONCE UPON A TIME…. sandman.
Lesson 3 Variables – How our Brains Work - Variables in Python.
Software Design & Development Software Design & Development Programming Types Event Driven Programming Event driven programming Is a type of programming.
Concept of Computer Programming November 2, 2011.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
Object-Oriented Design. From Analysis to Design Analysis Artifacts –Essential use cases What are the problem domain processes? –Conceptual Model What.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
Language Basics.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
INTRODUCTION TO PROGRAMMING STRUCTURE Chapter 4 1.
Eng. Mohammed Timraz Electronics & Communication Engineer University of Palestine Faculty of Engineering and Urban planning Software Engineering Department.
Introduction to Programming Lecture 1 – Overview
Invitation to Computer Science, Java Version, Second Edition.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 6 Value- Returning Functions and Modules.
Variables "There are 10 kinds of people in the world today – those who understand binary and those who don't!” Unknown.
Pseudo Code Possibly one of the hardest skills to get to grips with in learning a programming language is developing the ability to take a problem and.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Lecture Set 4 Data Types and Variables Part A – Introduction Numeric Data Types.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.
“The study of algorithms is the cornerstone of computer science.” Algorithms Fall 2011.
Logic Programming Module 2AIT202 Website Lecturer: Dave Sharp Room: AG15
1 Compiler Construction (CS-636) Muhammad Bilal Bashir UIIT, Rawalpindi.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
University of Sunderland CIF 102/FIF102 Fundamentals of DatabasesUnit 15 Programming in Microsoft Access using VBA Using VBA to add functionality.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
What is Programming? Computer programming is about telling the computer what it is we want it to do We tell the computer what we want it to do by sending.
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.
CS Class 03 Topics  Sequence statements Input Output Assignment  Expressions Read pages Read pages 40 – 49 for next time.
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
1 Project designed and created by M. Shajith Kumar.
Techniques for presenting content
Observations so far…. In general… There are two ways to design a software system –Centralized control One “driver” function that contains the entire algorithm.
Copyright 2006 by Timothy J. McGuire, Ph.D. 1 MIPS Assembly Language CS 333 Sam Houston State University Dr. Tim McGuire.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Algorithms and Pseudocode
Instructor: Chris Trenkov Hands-on Course Python for Absolute Beginners (Spring 2015) Class #003 (February 14, 2015)
Visual Basic/ Visual Studio Brandon Large. Connecting to prior knowledge In your notes write down what the two main parts of the computer are. The “software”
IMAT1604 Visual Web Development. About me… Matthew Dean (Or Google mjdean dmu)
Algorithms and Flowcharts
F453 Module 8: Low Level Languages 8.1: Use of Computer Architecture.
JavaScript Part 1 Introduction to scripting The ‘alert’ function.
Introduction to Programming Lecture 1 – Overview
Unit 2 Technology Systems
INTRODUCTION TO PROBLEM SOLVING
List Based Objects.
CS190/295 Programming in Python for Life Sciences: Lecture 1
Compiler Construction
Unit# 9: Computer Program Development
Language Basics.
List Based Objects.
What is an Object Anyway?
Algorithm and Ambiguity
Topics Introduction to Value-returning Functions: Generating Random Numbers Writing Your Own Value-Returning Functions The math Module Storing Functions.
List Based Objects.
List Based Objects.
3.2 Working with Data Scope of variables 29/07/2019.
Programming Logic and Design Eighth Edition
Presentation transcript:

Objects Methods and Instantiation

Programming Programming is the act of writing instructions that tell a computer how to do something. This module is a starting point into a huge topic You will almost certainly not get this on the first attempt I assume no prior knowledge of programming In this first lecture we will consider… How we may use a system of notation to control computer technology How objects may be used to represent and control computer technology via methods and properties The relationship between an object and a class and how instantiation creates an object from a class

Sending a Simple Instruction to a Computer I want the computer to shut down How would I do this? (Use of my senses) How would I tell one of you to do it? (Use of natural language) How do we tell the computer to turn itself off?

Natural Language and Computers “ok computer turn your self off now” Does the computer understand the words we have used? Strong regional accents? Consider the following… Off computer turn now OK puter turn thesel ov now Cmptr trn yrslf ff nw Natural language allows for ambiguity and imprecision Computers are really quite thick

Computer Programming and Music Parallels may be drawn between programming a computer and playing an instrument. (It is my observation that many programmers are also musicians) With music we have the same problem as with a computer How do we tell the instrument / musician what it is we want to hear?

What is this?

Add the words…

Music Notation as a Program Once you understand the rules you may create / play music of varying complexity The same tune may be reproduced on different instruments The basic rules are very simple The staff indicates the pitch of the sound… The shape of the notes tell us how long they should be played for… Sequence matters!

Symbols and Meaning We use symbols all of the time in our daily life “Represents” the tune “three blind mice” but it isn’t the tune De Montfort University The Gateway Leicester LE1 9BH Represents the address but it isn’t the place

Understanding the Symbols Understanding the symbols is the first problem you will face in learning how to program

Which Code is Correct? Dim MyAge As Integer MyAge = 23 If MyAge > 21 Then lblError-Text = "You are old enough" End If Or… Dim MyAge As Integer MyAge = 23 If MyAge > 21 Then lblError.Text = "You are old enough" End If

Computer Programming We want to create: A system that accurately identifies the individual components in a computer so we may control them A system that may be used to set the sequence of instructions such that they are carried out in the way we intend A system of representation that is easy to maintain avoiding unnecessary duplication and excess baggage Something that is reasonably easy for us as human beings to write and understand (we don’t want the symbols to get in the way of the meaning)

Objects, Classes, Methods, Properties and Instantiation Lots of new terms to understand Objects provide tools for referencing and controlling bits of the computer Classes are the “recipes” that define objects Methods tell objects to do something Properties control the settings of an object Instantiation is the act of making an object out of a class

Cuba the Cat - Properties Legs4 Tails1 Ears2 Fangs3 Properties tell us how the object is set up

Cuba the Cat - Methods Release - let Cuba outside Feed - give Cuba some food Scoop - clean up after Cuba Methods make the object do something

The Computer as an Object Properties and methods not about Cats We want to represent and control the computer View the computer system as a set of objects We may think of the computer expressed as an object MyComputer.TurnOff() MyComputer represents the entire computer TurnOff is a method that turns the computer off Starting to develop a system of notation rather like musical notation

Classes Classes contain the code defining an object

Instantiation Takes the recipe contained in the class and makes an object we may use

The Computer System We will be looking at a range of objects and classes allowing us to control different parts of the computer system The screen (buttons, text boxes and lists) The RAM (variables) A Database (DataConnection class) + others Also look at control structures (assignment, functions, loops, if statements)

The Three Layer Architecture

Overview Don’t get bogged down in the detail! Programming is the act of writing instructions that tell a computer how to do something We need a standard system of notation allowing us to represent what the computer is to do that makes reasonable sense to human beings

Important Key Concepts ObjectA way of representing computer technology so that we may control it MethodUsed to tell an object to do something PropertyUsed to find out or control something out about the object ClassThe definition for an object InstantiationThe process of making an object from a class

Computer System Split into Layers The Presentation Layer – the part the user interacts with The Middle Layer – containing classes allowing us to do things The Data Layer – where are database is stored

Finally… There is one final way in which programming is like music! Both require constant hands-on practise! You must do the work! You will not learn how to program on the first second or third attempt You must practise and refine your skills