Lecture 1: a partial introduction to Prolog
|
|
- Arleen McCormick
- 6 years ago
- Views:
Transcription
1 Lecture 1: a partial introduction to Prolog First programs in Prolog including: working with objects to display information; change contents of an object; comparing and contrasting Prolog and Java; briefly introducing variables and assignment in Prolog.
2 Contact hours Lectures: Semester 1 Monday Thursday Labs/workshops: UG04 Semester 1 Monday Thursday Friday Catch up sessions: to be arranged on demand Introductory matters 1
3 Important Facts Assessment Examination: 80% - May/June 2013 Continuous assessment: Tutorial sheets - getting harder and harder. See Module Web page: ~pjh/modules/current/25433/25433.html Introductory matters 2
4 Teaching method: try it out How to study? Use the resources available: WWW Prolog notes textbooks tutorials demonstrators electronic communication Introductory matters 3
5 WWW teaching resource What the WWW material contains explanations of the essentials of Prolog self-test exercises complete set of solutions How to access it From the Module Web page: ~pjh/modules/current/25433/25433.html Introductory matters 4
6 Feedback Tutorial sheets designed to help you firm-up lecture material; extend your knowledge and experience of Prolog; to understand how Prolog differs from procedural languages; assess how well you are doing and take action to improve; identify topics you find difficult and ask for extra help. Tutorial sheets are handed back within two weeks. Introductory matters 5
7 Introducing Prolog - 1 Examples based on a bank account object. Specifically: displaying the balance of the bank account object changing the balance of the bank account object Based on the introductory example in: Core Java by Cay Horstmann. 1 - Introduction 6
8 The deeper purpose: Introducing Prolog - 2 to introduce the syntax of Prolog - how programs are typed on the screen; to introduce the semantics: declarative semantics: what Prolog programs mean; procedural semantics: how a Prolog program is executed. 1 - Introduction 7
9 The trivial pursuit Some differences between languages are trivial: Java:!= Prolog: =\= Some differences are a matter of style: Java: bankaccount Prolog: bank_account Some differences aren t trivial e.g. variables: Java: balance Prolog: Balance Some differences are at the heart of a language: Java: a = a + 5 Prolog: B is A Introduction 8
10 Step 1- output This example shows: most of the syntax of Prolog; Prolog passes objects in explicit parameters; how to output to the current stream in Prolog; everything is either true or it fails in Prolog. What does this rule do? displays a bank balance on the screen. 1 - Introduction 9
11 Your first Prolog rule display_balance(bank_account(no, Name, Balance)) :- write(name), write(' account no: '), write(no), nl, write('your balance is: '), write(balance), nl. 1 - Introduction 10
12 Your first Prolog rule display_balance(bank_account(no, Name, Balance)) :- write(name), write(' account no: '), functor the name of the rule write(no), nl, write('your balance is: '), write(balance), nl. 1 - Introduction 11
13 Your first Prolog rule display_balance(bank_account(no, Name, Balance)) :- write(name), write(' account no: '), write(no), nl, write('your balance parameter is: list '), write(balance), An object is passed nl. explicitly into this rule 1 - Introduction 12
14 Your first Prolog rule display_balance(bank_account(no, Name, Balance)) :- write(name), write(' account no: '), write(no), nl, write('your balance is: '), write(balance), nl. built-in predicates write/1 and nl/0 are part of Prolog 1 - Introduction 13
15 Your first Prolog rule display_balance(bank_account(no, Name, Balance)) :- write(name), write(' account no: '), write(no), nl, if write('your balance is: '), write(balance), nl. The head of the rule is true if the body of the rule can be proved true. 1 - Introduction 14
16 Your first Prolog rule display_balance(bank_account(no, Name, Balance)) :- write(name), write(' account no: '), write(no), nl, write('your balance is: '), write(balance), nl., usually means and in Prolog. Prolog is very fussy about full-stops. 1 - Introduction 15
17 A second rule write_message(message(text1, Text2)) :- write(text1), write(' : '), write(text2), nl. Yes! Prolog is an untyped language. This displays any message/2 object whatever type their parameters are. 1 - Introduction 16
18 Calling the second rule from the first display_balance(bank_account(no, Name, Balance)) :- write(name), write_message(message(' account no: ', No)), write_message(message( balance is: ', User-defined predicates are called just like Prolog s own predicates. Balance)). 1 - Introduction 17
19 Consolidation moment Prolog s built-in predicates and user-defined predicates look the same and behave the same. Every predicate in Prolog returns true (yes) or fail (no). All of you can now write a Prolog rule. 1 - Introduction 18
20 Consolidation moment Prolog s built-in predicates and user-defined predicates look the same and behave the same. Every predicate in Prolog returns true or fail. All of you can now write a Prolog rule. Hold onto this: you ll need it to understand the last example 1 - Introduction 19
21 Withdrawing money from an account request_withdrawal(bank_account) :- write('welcome to the bank'), nl, display_balance(bank_account), write('how much do you want? '), read(cash), withdraw_cash(bank_account, Cash), display_balance(bank_account). withdraw_cash(bank_account, Cash) :- write_message(message(bank_account, Cash)). 1 - Introduction 20
22 Withdrawing money from an account request_withdrawal(bank_account) :- write('welcome to the bank'), nl, display_balance(bank_account), write('how much do you want? '), read(cash), withdraw_cash(bank_account, Cash), display_balance(bank_account). read/1 gets input from the current stream - i.e. the keyboard withdraw_cash(bank_account, Cash) :- write_message(message(bank_account, Cash)). 1 - Introduction 21
23 Withdrawing money from an account request_withdrawal(bank_account) :- write('welcome to the bank'), nl, display_balance(bank_account), write('how much do you want? '), read(cash), This is a stub - until we withdraw_cash(bank_account, Cash), display_balance(bank_account). write the proper code. withdraw_cash(bank_account, Cash) :- write_message(message(bank_account, Cash)). 1 - Introduction 22
24 Withdrawing money from an account withdraw_cash(bank_account(_no, _Name, Balance), Cash) :- Balance is Balance - Cash. This won t work because it is illogical for a variable to have two values simultaneously. 1 - Introduction 23
25 Withdrawing money from an account withdraw_cash(bank_account(_no, _Name, Balance), Cash) :- New_Balance is Balance - Cash. This won t work because there is no way of sending this variable back to the calling rule. 1 - Introduction 24
26 Withdrawing money from an account withdraw_cash(bank_account(no, Name, Old_Balance), Cash, bank_account(no, Name, New_Balance)) :- New_Balance is Old_Balance - Cash. 1 - Introduction 25
27 Withdrawing money from an account We can only communicate with the withdraw_cash(bank_account(no, calling Name, rule through a Old_Balance), parameter. Cash, bank_account(no, Name, New_Balance)) :- New_Balance is Old_Balance - Cash. 1 - Introduction 26
28 Withdrawing money from an account withdraw_cash(bank_account(no, Name, Old_Balance), in the parameters Cash, bank_account(no, Name, New_Balance)) :- New_Balance is Old_Balance - Cash. The variable has to be 1 - Introduction 27
29 We have to change the calling rule request_withdrawal(old_bank_account) :- write('welcome to the bank'), nl, display_balance(old_bank_account), write('how much do you want? '), read(cash), withdraw_cash(old_bank_account, Cash, New_Bank_Account), display_balance(new_bank_account). 1 - Introduction 28
30 We have to change the calling rule request_withdrawal(old_bank_account) :- write('welcome to the bank'), nl, arguments display_balance(old_bank_account), write('how much do you want? '), read(cash), withdraw_cash(old_bank_account, Cash, New_Bank_Account), display_balance(new_bank_account). This call now has three 1 - Introduction 29
31 Consolidation moment Variables can t be reassigned - it s not logical. Var is Var +1 is as logical as saying: 1 is For your rules to communicate with other rules, you have to: send information in through the parameter list; send information back out through the parameter list. 1 - Introduction 30
32 But banks aren t usually generous These days, banks don t seem to like people going overdrawn. We can change the code to stop customers going overdrawn - but it involves a massive step in your knowledge of Prolog: You are about to learn how to write IF - THEN - ELSE in Prolog 1 - Introduction 31
33 Declaring what we know about being in the black All we need to do is to add a test that the account isn t overdrawn: withdraw_cash(bank_account(no, Name, Old_Balance), Cash, bank_account(no, Name, New_Balance)) :- New_Balance is Old_Balance - Cash, New_Balance >= Introduction 32
34 But if the customer takes too much the program will fail Yes - but sometimes we want failure usually we want local failure - but that s for another day. Here, we want the customer to get a helpful message and then to continue the banking system. So we add an alternative rule: 1 - Introduction 33
35 Declaring what we know about trying to be in the red Note: this rule has the same name and parameters as the previous rule. withdraw_cash(bank_account(no, Name, Old_Balance), Cash, bank_account(no, Name, Old_Balance)) :- New_Balance is Old_Balance - Cash, New_Balance < 0.0, write_message(message( Account, in the red')). 1 - Introduction 34
36 If at first you don t succeed, try, try again When there is a choice of rules, Prolog tries the first and, if it works, returns true and carries on If the rule fails, it tries the next, and the next and the next, etc, until: either it finds a true rule or it fails (catastrophically) 1 - Introduction 35
37 A question Why can t Prolog have the ++ operator? For instance: A_Variable Introduction 36
38 What s ahead? Your lab session in: at 4 pm today. Collecting a tutorial sheet which will introduce you to the basics of Prolog. Sadly, the tutorial sheet is not available on the WWW. 1 - Introduction 37
39 Finally: a message from our sponsor Of course, that is irony. Irony is saying one thing and meaning the opposite! 1 - Introduction 38
CSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209
CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System
More informationProgramming Language Concepts, cs2104 Lecture 01 ( )
Programming Language Concepts, cs2104 Lecture 01 (2003-08-15) Seif Haridi Department of Computer Science, NUS haridi@comp.nus.edu.sg 2002-08-15 S. Haridi, CS2104, L01 (slides: C. Schulte, S. Haridi) 1
More informationIntroduction to Programming System Design CSCI 455x (4 Units)
Introduction to Programming System Design CSCI 455x (4 Units) Description This course covers programming in Java and C++. Topics include review of basic programming concepts such as control structures,
More informationIntroduction to Databases Fall-Winter 2010/11. Syllabus
Introduction to Databases Fall-Winter 2010/11 Syllabus Werner Nutt Syllabus Lecturer Werner Nutt, nutt@inf.unibz.it, Room POS 2.09 Office hours: Tuesday, 14:00 16:00 and by appointment (If you want to
More informationIntroduction to Software Development (ISD) David Weston and Igor Razgon
Introduction to Software Development (ISD) David Weston and Igor Razgon Autumn term 2013 Course book The primary book supporting the ISD module is: Java for Everyone, by Cay Horstmann, 2nd Edition, Wiley,
More informationAgenda: Notes on Chapter 3. Create a class with constructors and methods.
Bell Work 9/19/16: How would you call the default constructor for a class called BankAccount? Agenda: Notes on Chapter 3. Create a class with constructors and methods. Objectives: To become familiar with
More informationCS558 Programming Languages
CS558 Programming Languages Winter 2017 Lecture 7b Andrew Tolmach Portland State University 1994-2017 Values and Types We divide the universe of values according to types A type is a set of values and
More informationSpring 2003 Instructor: Dr. Shahadat Hossain. Administrative Matters Course Information Introduction to Programming Techniques
1 CPSC2620 Advanced Programming Spring 2003 Instructor: Dr. Shahadat Hossain 2 Today s Agenda Administrative Matters Course Information Introduction to Programming Techniques 3 Course Assessment Lectures:
More informationProject 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently.
Project 1 Computer Science 2334 Spring 2016 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple movie data system. Milestones: 1. Use
More informationKOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)
Programming Concepts & Algorithms Course Syllabus Course Title Course Code Computer Department Pre-requisites Course Code Course Instructor Programming Concepts & Algorithms + lab CPE 405C Computer Department
More informationIntroduction to Databases Fall-Winter 2009/10. Syllabus
Introduction to Databases Fall-Winter 2009/10 Syllabus Werner Nutt Syllabus Lecturer Werner Nutt, nutt@inf.unibz.it, Room TRA 2.01 Office hours: Thursday, 16:00 18:00 (If you want to meet up with me, send
More informationAnnouncements. 1. Forms to return today after class:
Announcements Handouts (3) to pick up 1. Forms to return today after class: Pretest (take during class later) Laptop information form (fill out during class later) Academic honesty form (must sign) 2.
More informationCivil Engineering Computation
Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday
More informationB. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics
Zarqa University Faculty: Information Technology Department: Computer Science Course title: Programming LAB 1 (1501111) Instructor: Lecture s time: Semester: Office Hours: Course description: This introductory
More informationCSC209. Software Tools and Systems Programming. https://mcs.utm.utoronto.ca/~209
CSC209 Software Tools and Systems Programming https://mcs.utm.utoronto.ca/~209 What is this Course About? Software Tools Using them Building them Systems Programming Quirks of C The file system System
More informationint main() { int account = 100; // Pretend we have $100 in our account int withdrawal;
Introduction to Exceptions An exception is an abnormal condition that occurs during the execution of a program. For example, divisions by zero, accessing an invalid array index, or ing to convert a letter
More informationAdvances in Programming Languages: Exam preparation and exam questions
Advances in Programming Languages: Exam preparation and exam questions Stephen Gilmore The University of Edinburgh March 24, 2006 Examinations What is the purpose of examinations? 1. To test understanding.
More informationCS354 gdb Tutorial Written by Chris Feilbach
CS354 gdb Tutorial Written by Chris Feilbach Purpose This tutorial aims to show you the basics of using gdb to debug C programs. gdb is the GNU debugger, and is provided on systems that
More information1001ICT Introduction To Programming Lecture Notes
1001ICT Introduction To Programming Lecture Notes School of Information and Communication Technology Griffith University Semester 2, 2015 1 2 Elements of Java Java is a popular, modern, third generation
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/27/17
01.433/33 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Priority Queues / Heaps Date: 9/2/1.1 Introduction In this lecture we ll talk about a useful abstraction, priority queues, which are
More informationComp 151. Control structures.
Comp 151 Control structures. admin For these slides read chapter 7 Yes out of order. Simple Decisions So far, we ve viewed programs as sequences of instructions that are followed one after the other. While
More informationSoftware Design and Analysis for Engineers
Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 2 Date:
More informationWestpac phone banking
Westpac phone banking Fast, reliable, convenient banking Terms, conditions, fees and charges apply to Westpac products and services. See the Transaction and Service Fees brochure available from your local
More informationCS61B Lecture #7. Announcements:
Announcements: CS61B Lecture #7 New discussion section: Tuesday 2 3PM in 310 Soda. New lab section: Thursday 2 4PM in 273 Soda. Programming Contest coming up: 5 October (new date). Watch for details. Last
More informationCSCI-1200 Data Structures Spring 2018 Lecture 25 Garbage Collection & Smart Pointers
CSCI-1200 Data Structures Spring 2018 Lecture 25 Garbage Collection & Smart Pointers Announcements Please fill out your course evaluations! Those of you interested in becoming an undergraduate mentor for
More informationBefore We Begin. Introduction to Computer Use II. Overview (1): Winter 2006 (Section M) CSE 1530 Winter Bill Kapralos.
Winter 2006 (Section M) Topic E: Subprograms Functions and Procedures Wednesday, March 8 2006 CSE 1530, Winter 2006, Overview (1): Before We Begin Some administrative details Some questions to consider
More informationAnatomy of a Method. HW3 is due Today. September 15, Midterm 1. Quick review of last lecture. Encapsulation. Encapsulation
Anatomy of a Method September 15, 2006 HW3 is due Today ComS 207: Programming I (in Java) Iowa State University, FALL 2006 Instructor: Alexander Stoytchev Midterm 1 Next Tuesday Sep 19 @ 6:30 7:45pm. Location:
More informationTA hours and labs start today. First lab is out and due next Wednesday, 1/31. Getting started lab is also out
Announcements TA hours and labs start today. First lab is out and due next Wednesday, 1/31. Getting started lab is also out Get you setup for project/lab work. We ll check it with the first lab. Stars
More informationCS 1110, LAB 10: ASSERTIONS AND WHILE-LOOPS 1. Preliminaries
CS 0, LAB 0: ASSERTIONS AND WHILE-LOOPS http://www.cs.cornell.edu/courses/cs0/20sp/labs/lab0.pdf. Preliminaries This lab gives you practice with writing loops using invariant-based reasoning. Invariants
More informationProject #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently.
Project #1 rev 2 Computer Science 2334 Fall 2013 This project is individual work. Each student must complete this assignment independently. User Request: Create a simple magazine data system. Milestones:
More informationCS 4349 Lecture October 18th, 2017
CS 4349 Lecture October 18th, 2017 Main topics for #lecture include #minimum_spanning_trees. Prelude Homework 6 due today. Homework 7 due Wednesday, October 25th. Homework 7 has one normal homework problem.
More informationCSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN
What languages do you know? CSC 326H1F, Programming Languages The usual suspects: C, C++, Java fine languages nearly the same Perhaps you've also learned some others? assembler Basic, Visual Basic, Turing,
More informationStarting to Program in C++ (Basics & I/O)
Copyright by Bruce A. Draper. 2017, All Rights Reserved. Starting to Program in C++ (Basics & I/O) On Tuesday of this week, we started learning C++ by example. We gave you both the Complex class code and
More information(Refer Slide Time 01:41 min)
Programming and Data Structure Dr. P.P.Chakraborty Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture # 03 C Programming - II We shall continue our study of
More informationCS101 Introduction to Programming Languages and Compilers
CS101 Introduction to Programming Languages and Compilers In this handout we ll examine different types of programming languages and take a brief look at compilers. We ll only hit the major highlights
More informationUnit 7: Algorithms and Python CS 101, Fall 2018
Unit 7: Algorithms and Python CS 101, Fall 2018 Learning Objectives After completing this unit, you should be able to: Identify whether a sequence of steps is an algorithm in the strict sense. Explain
More informationCOURSE SYLLABUS FOR. COMP-297 Web Page Design: Adobe Dreamweaver
Coffeyville Community College COURSE SYLLABUS FOR COMP-297 Web Page Design: Adobe Dreamweaver Mrs. Darla Thornburg Spring 2018 Page 1 of 8 COURSE NUMBER: COURSE TITLE: CREDIT HOURS: INSTRUCTOR: OFFICE
More informationQUICK EXCEL TUTORIAL. The Very Basics
QUICK EXCEL TUTORIAL The Very Basics You Are Here. Titles & Column Headers Merging Cells Text Alignment When we work on spread sheets we often need to have a title and/or header clearly visible. Merge
More informationCS558 Programming Languages
CS558 Programming Languages Fall 2016 Lecture 7a Andrew Tolmach Portland State University 1994-2016 Values and Types We divide the universe of values according to types A type is a set of values and a
More informationPhone banking Fast, reliable and convenient service by phone.
Phone banking. Contents Get to the bank when it suits you 6 Getting started 6 Setting up accounts 7 What does it cost? 7 Time saving options 7 Fast balances 7 Fast codes 7 Fax information 8 Bill payments
More informationCompilers - Chapter 2: An introduction to syntax analysis (and a complete toy compiler)
Compilers - Chapter 2: An introduction to syntax analysis (and a complete toy compiler) Lecturers: Paul Kelly (phjk@doc.ic.ac.uk) Office: room 304, William Penney Building Naranker Dulay (nd@doc.ic.ac.uk)
More informationCOSC 2P91. Introduction Part Deux. Week 1b. Brock University. Brock University (Week 1b) Introduction Part Deux 1 / 14
COSC 2P91 Introduction Part Deux Week 1b Brock University Brock University (Week 1b) Introduction Part Deux 1 / 14 Source Files Like most other compiled languages, we ll be dealing with a few different
More informationFIT3056 Secure and trusted software systems. Unit Guide. Semester 2, 2010
FIT3056 Secure and trusted software systems Unit Guide Semester 2, 2010 The information contained in this unit guide is correct at time of publication. The University has the right to change any of the
More informationCSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch
CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch Purpose: We will take a look at programming this week using a language called Scratch. Scratch is a programming language that was developed
More informationB.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET
B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET Course Outline The main objective of this course is to introduce students to the basic concepts of a selected language
More information» How do I Integrate Excel information and objects in Word documents? How Do I... Page 2 of 10 How do I Integrate Excel information and objects in Word documents? Date: July 16th, 2007 Blogger: Scott Lowe
More informationMath Dr. Miller - Constructing in Sketchpad (tm) - Due via by Friday, Mar. 18, 2016
Math 304 - Dr. Miller - Constructing in Sketchpad (tm) - Due via email by Friday, Mar. 18, 2016 As with our second GSP activity for this course, you will email the assignment at the end of this tutorial
More informationTutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment
60-212 subir@cs.uwindsor.ca Phone # 253-3000 Ext. 2999 web site for course www.cs.uwindsor.ca/60-212 Dr. Subir Bandyopadhayay Website has detailed rules and regulations All assignments and labs will be
More informationDomain Splitting CPSC 322 CSP 4. Textbook 4.6. February 4, 2011
Domain Splitting CPSC 322 CSP 4 Textbook 4.6 February 4, 2011 Pace Discussion of feedback 2 fine, 1 could go faster 2: recap too long, 3: sometimes rushed later (as a consequence) Coloured card questions
More informationCS112 Lecture: Defining Instantiable Classes
CS112 Lecture: Defining Instantiable Classes Last revised 2/3/05 Objectives: 1. To describe the process of defining an instantiable class 2. To discuss public and private visibility modifiers. Materials:
More informationCSCI 141 Computer Programming I. Filip Jagodzinski
Filip Jagodzinski Announcement Using online resources for help I want you to learn from others I want you to learn how to use (good) online resources Learning on your own is a good thing Announcement Using
More informationProgramming Languages and Techniques (CIS120)
Programming Languages and Techniques () Lecture 12 February 7, 2018 Partiality, Sequencing, Records Chapters 12, 13 Midterm 1 This Friday in class Review session Tonight, 6 7:30 PM DRLB A1 Announcements
More informationCS112 Lecture: Primitive Types, Operators, Strings
CS112 Lecture: Primitive Types, Operators, Strings Last revised 1/24/06 Objectives: 1. To explain the fundamental distinction between primitive types and reference types, and to introduce the Java primitive
More informationCS 4349 Lecture August 21st, 2017
CS 4349 Lecture August 21st, 2017 Main topics for #lecture include #administrivia, #algorithms, #asymptotic_notation. Welcome and Administrivia Hi, I m Kyle! Welcome to CS 4349. This a class about algorithms.
More informationLecture 16: HashTables 10:00 AM, Mar 2, 2018
CS18 Integrated Introduction to Computer Science Fisler, Nelson Lecture 16: HashTables 10:00 AM, Mar 2, 2018 Contents 1 Speeding up Lookup 1 2 Hashtables 2 2.1 Java HashMaps.......................................
More informationComputer Science E-50a: Introduction to Computer Science Using Java, I Handout #7 part 2
Computer Science E-50a: Introduction to Computer Science Using Java, I Handout #7 part 2 part 2 These problems are due prior to the start of lecture on Monday night, March 31. Part A The Reading You may
More informationCS 106X, Lecture 14 Classes and Pointers
CS 106X, Lecture 14 Classes and Pointers reading: Programming Abstractions in C++, Chapter 6, 11 This document is copyright (C) Stanford Computer Science and Nick Troccoli, licensed under Creative Commons
More informationCS453 Compiler Construction
CS453 Compiler Construction Original Design: Michelle Strout Instructor: Wim Bohm wim.bohm@gmail.com, bohm@cs.colostate.edu Computer Science Building 344 Office hour: Monday 1-2pm TA: Andy Stone aistone@gmail.com,
More informationSoftware Design and Analysis for Engineers
Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 9 Date:
More informationJavaScript. Like PHP, JavaScript is a modern programming language that is derived from the syntax at C.
Like PHP, JavaScript is a modern programming language that is derived from the syntax at C. It has been around just about as long as PHP, also having been invented in 1995. JavaScript, HTML, and CSS make
More informationSTUDENT LESSON A5 Designing and Using Classes
STUDENT LESSON A5 Designing and Using Classes 1 STUDENT LESSON A5 Designing and Using Classes INTRODUCTION: This lesson discusses how to design your own classes. This can be the most challenging part of
More informationExercises: Instructions and Advice
Instructions Exercises: Instructions and Advice The exercises in this course are primarily practical programming tasks that are designed to help the student master the intellectual content of the subjects
More informationProgramming with CUDA
Programming with CUDA Jens K. Mueller jkm@informatik.uni-jena.de Department of Mathematics and Computer Science Friedrich-Schiller-University Jena Monday 4 th April, 2011 Today s lecture: Organization
More informationThese are notes for the third lecture; if statements and loops.
These are notes for the third lecture; if statements and loops. 1 Yeah, this is going to be the second slide in a lot of lectures. 2 - Dominant language for desktop application development - Most modern
More informationChapter01.fm Page 1 Monday, August 23, :52 PM. Part I of Change. The Mechanics. of Change
Chapter01.fm Page 1 Monday, August 23, 2004 1:52 PM Part I The Mechanics of Change The Mechanics of Change Chapter01.fm Page 2 Monday, August 23, 2004 1:52 PM Chapter01.fm Page 3 Monday, August 23, 2004
More informationAdministrivia. IBM Info Session Date: Wed,, Jan 13 Time: 5:30 7 pm Location: Wesbrook 100
Department of Computer Science Undergraduate Events Events this week Drop-In Resume Edition Date: Mon. Jan 11 Time: 11 am 2 pm Location: Rm 255, ICICS/CS Industry Panel Speakers: Managers from IBM, Microsoft,
More informationEE3315 Internet Technology EE3315 Internet Technology Overview Slide 1
EE3315 Internet Technology http://www.cityu.edu.hk/ug/current/course/ee3315.htm EE3315 Internet Technology Overview Slide 1 Course Aim This course aims to provide students with the knowledge of key protocols
More informationENCM 369 Winter 2017 Lab 3 for the Week of January 30
page 1 of 11 ENCM 369 Winter 2017 Lab 3 for the Week of January 30 Steve Norman Department of Electrical & Computer Engineering University of Calgary January 2017 Lab instructions and other documents for
More informationProgramming Languages and Techniques (CIS120)
Programming Languages and Techniques () Lecture 1 Welcome Introduction to Program Design Introductions Dr. Mitch Marcus Levine 503 http://www.cis.upenn.edu/~mitch/ mitch@cis.upenn.edu Dr. Stephanie Weirich*
More informationUNIT I Programming Language Syntax and semantics. Kainjan Sanghavi
UNIT I Programming Language Syntax and semantics B y Kainjan Sanghavi Contents Bird s eye view of programming language concepts Syntax Semantics Pragmatics Programming Language Concepts A programming language
More informationENCM 335 Fall 2018 Lab 2 for the Week of September 24
page 1 of 8 ENCM 335 Fall 2018 Lab 2 for the Week of September 24 Steve Norman Department of Electrical & Computer Engineering University of Calgary September 2018 Lab instructions and other documents
More informationCS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011
CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e
More informationProcessing lists in Prolog - 2
Processing lists in Prolog - 2 This lecture shows that techniques introduced before (analysing terminating conditions and recursive programming) can be used to develop more complex procedures. This lecture
More informationITT8060 Advanced Programming
ITT8060 Advanced Programming In F# Juhan Ernits Welcome to Advanced Programming (in F#)! Teachers: Juhan Ernits Hendrik Maarand Course web page http://courses.cs.ttu.ee/pages/itt8060 Contact: juhan.ernits@ttu.ee
More informationCMSC 150 INTRODUCTION TO COMPUTING LAB WEEK 3 STANDARD IO FORMATTING OUTPUT SCANNER REDIRECTING
CMSC 150 INTRODUCTION TO COMPUTING LAB WEEK 3 STANDARD IO FORMATTING OUTPUT SCANNER REDIRECTING INPUT AND OUTPUT Input devices Keyboard Mouse Hard drive Network Digital camera Microphone Output devices.
More informationJAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015
JAVA REVIEW cs2420 Introduction to Algorithms and Data Structures Spring 2015 1 administrivia 2 -Lab 0 posted -getting started with Eclipse -Java refresher -this will not count towards your grade -TA office
More informationDCS/100: Procedural Programming
DCS/100: wk 3 p.1/50 DCS/100: Procedural Programming Week 3: Making Decisions Queen Mary, University of London DCS/100: wk 3 p.2/50 Last Week From last week you should be able to explain and write programs
More informationSchool of Computer Science
School of Computer Science Computer Science (CS) modules CS1002 Object-Oriented Programming Computer Science - 1000 & 2000 Level - 2016/7 - December 2016 SCOTCAT Credits: 20 SCQF Level 7 Semester: 1 3.00
More informationCSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I
CSCI 1100L: Topics in Computing Lab Lab 1: Introduction to the Lab! Part I Welcome to your CSCI-1100 Lab! In the fine tradition of the CSCI-1100 course, we ll start off the lab with the classic bad joke
More informationIntroduction to Computation and Problem Solving
Class 1: Introduction Introduction to Computation and Problem Solving Prof. Steven R. Lerman and Dr. V. Judson Harward Handouts for Today Course syllabus Academic Honesty Guidelines Laptop request form
More informationSOFTWARE ENGINEERING DESIGN I
2 SOFTWARE ENGINEERING DESIGN I 3. Schemas and Theories The aim of this course is to learn how to write formal specifications of computer systems, using classical logic. The key descriptional technique
More informationCSC 111 Introduction to Computer Science (Section C)
CSC 111 Introduction to Computer Science (Section C) Course Description: (4h) Lecture and laboratory. Rigorous introduction to the process of algorithmic problem solving and programming in a modern programming
More informationCSCD 330 Network Programming
CSCD 330 Network Programming Lecture 12 More Client-Server Programming Winter 2019 Reading: References at end of Lecture 1 Introduction So far, Looked at client-server programs with Java Sockets TCP and
More informationCSE : Python Programming
CSE 399-004: Python Programming Lecture 2: Data, Classes, and Modules January 22, 2007 http://www.seas.upenn.edu/~cse39904/ Administrative things Teaching assistant Brian Summa (bsumma @ seas.upenn.edu)
More informationMODULE CODE MODULE NAME. NQF level. [Number of credits] Name of department. Faculty. Compiled by (Name of lecturer) YEAR
MODULE CODE MODULE NAME NQF level [Number of credits] Name of department Faculty Compiled by (Name of lecturer) YEAR TABLE OF CONTENTS 1. Welcoming... 5 2. Contact Sessions... 5 3. Study Material... 6
More informationAnnouncements. Course syllabus Tutorial/lab signup form (due 4pm today) Lecture 1 notes Homework 1 Initial assessment
Announcements Handouts (5) to pick up Course syllabus Tutorial/lab signup form (due 4pm today) Lecture 1 notes Homework 1 Initial assessment Please do it now and hand it in as you leave lecture It s ungraded;
More informationCS 210 Algorithms and Data Structures College of Information Technology and Engineering Weisberg Division of Engineering and Computer Science
CS 210 Algorithms and Data Structures College of Information Technology and Engineering Weisberg Division of Engineering and Computer Science Semester and Year: Fall 2008 Classroom Section, Meeting Times,
More informationSlide Set 1. for ENCM 339 Fall Steve Norman, PhD, PEng. Electrical & Computer Engineering Schulich School of Engineering University of Calgary
Slide Set 1 for ENCM 339 Fall 2016 Steve Norman, PhD, PEng Electrical & Computer Engineering Schulich School of Engineering University of Calgary September 2016 ENCM 339 Fall 2016 Slide Set 1 slide 2/43
More informationLecture 9: July 14, How to Think About Debugging
Lecture 9: July 14, 2011 How to Think About Debugging So, you wrote your program. And, guess what? It doesn t work. L Your program has a bug in it Somehow, you must track down the bug and fix it Need to
More informationCMPT 100 : INTRODUCTION TO
CMPT 100 : INTRODUCTION TO COMPUTING TUTORIAL #5 : JAVASCRIPT 2 GUESSING GAME 1 By Wendy Sharpe BEFORE WE GET STARTED... If you have not been to the first tutorial introduction JavaScript then you must
More informationDATABASE TRANSACTIONS. CS121: Relational Databases Fall 2017 Lecture 25
DATABASE TRANSACTIONS CS121: Relational Databases Fall 2017 Lecture 25 Database Transactions 2 Many situations where a sequence of database operations must be treated as a single unit A combination of
More informationWelcome to CS 135 (Winter 2018)
Welcome to CS 135 (Winter 2018) Instructors: Sandy Graham, Paul Nijjar Other course personnel: see website for details ISAs (Instructional Support Assistants) IAs (Instructional Apprentices) ISC (Instructional
More informationFinal Exam. Programming Assignment 3. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings
University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Interfaces vs. Inheritance Abstract Classes Inner Classes Readings This Week: No new readings. Consolidate! (Reminder: Readings
More informationCS 101: Computer Programming and Utilization. Abhiram Ranade
CS 101: Computer Programming and Utilization Abhiram Ranade CS 101: Computer Programming and Utilization Abhiram Ranade Course Overview How to represent problems on a computer and solve them Programming
More informationNetworked Systems and Services, Fall 2018 Chapter 1. Jussi Kangasharju Markku Kojo Lea Kutvonen
Networked Systems and Services, Fall 2018 Chapter 1 Jussi Kangasharju Markku Kojo Lea Kutvonen Course topic and goals Networked systems and services In particular, their reliability from various points
More informationComp 151. Control structures.
Comp 151 Control structures. admin quiz this week believe it or not only 2 weeks from exam. one a week each week after that. idle debugger Debugger: program that will let you look at the program as it
More informationMidterms Save the Dates!
University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Creating Your Own Class Lecture 7 Readings This Week s Reading: Ch 3.1-3.8 (Major conceptual jump) Next Week: Review Ch 1-4 (that
More informationBasic Class Diagrams. Class Diagrams, cont d. Class Diagrams, cont d. Car. Car. Car. What does the minus sign here mean?
Class #02: Inheritance and Object-Oriented Design Software Design II (CS 220): M. Allen, 23 Jan. 18 Basic Class Diagrams Describes a class and how it can be used properly Sketch of properties and behaviors
More informationComputer Science II Lecture 1 Introduction and Background
Computer Science II Lecture 1 Introduction and Background Discussion of Syllabus Instructor, TAs, office hours Course web site, http://www.cs.rpi.edu/courses/fall04/cs2, will be up soon Course emphasis,
More information} Each object in a Java program has an identifier (name) } This includes:
Class #05: More about Objects and Methods Software Design I (CS 120): M. Allen, 11 Sept. 2018 Important Java Syntax I: Identifiers Each object in a Java program has an identifier (name) This includes:
More information