System Modelling. Lecture

Size: px
Start display at page:

Download "System Modelling. Lecture"

Transcription

1 System Modelling Lecture

2 Lecture Objectives Storyboards as a base Objects to Classes GUI design with Story-Driven Modelling Intro to the project: 25pts

3 Story-Driven Modeling 1. Concrete behavior steps described by the client and captured in a scenario (working with client to make it concrete) 2. Modeling system "snapshots" with Object Diagrams for each scenario step and producing a Storyboard as a result 3. Modeling UML class diagram based on the Storyboard (still depends on experience) First step to abstraction (UML class diagram model only the static structure of program) Common mistake to use it for behavior design discussions 4. GUI Design and Initialization methods 3/59

4 Objects to Classes

5 Modeling UML class Diagram Going abstract Start assigning types to objects and keep an eye on the class diagram to avoid introducing of similar class twice Next, for each property of an object, we introduce an attribute declaration in the corresponding class Associations between classes and multiplicities based on the observed object diagrams 5/59

6 Modeling UML class Diagram? 6/59

7 Modeling UML class Diagram Simple Solution, but stresses the amount of logic needed to handle the special case of Exam room Restriction: nearly always bad idea, need to check initialization 7/59

8 Changes in plan? What if courses may move to the other rooms when student is studying? Hint: courses have some behavior and becoming mobile 8/59

9 Changes in plan? 9/59

10 Changes in plan? 10/59

11 Inheritance vs Association If there is some attribute/behavior that belongs to many classes

12 Inheritance vs Association ExamRoom Room Student 12/59 Student can be associated with objects of different class Capture this behavior in one place, like Space class

13 Modeling UML class Diagram A little more complicated and flexible solution if we expect changes in the plan 13/59 Example: If we introduce more kind of rooms (prerequisition to take the course)

14 Danger of Inheritance Hierarchy > 7 can explode the number of methods, confusing, poorly maintainable, overburdened local namespace Depth > 3 overridden methods that call each other and jumping around in the hierarchy are very difficult and error-prone to implement The derived class does not in practice, usually only specializes things, but often you have to overwrite methods in order to "generalize" behavior of the upper class, which contradicts the concept 14/59

15 Use of Inheritance Inheritance is usually used only in cases of fulfilling design pattern Don't use inheritance if you are unsure Maintanability, readibility become harder The bigger the project the more dangerous is inheritance Learn more in the Design Pattern course 15/59

16 Modeling UML class Diagram 16/59

17 Multiplicities and Associations Multiplicities and bounds Put bounds only when it is important for application Lower bounds: hardly ever Upper bound: seldom Try to introduce new object and keep logic for associations in one place 17/59

18 Classes to Code 18/59

19 Class Diagram to Code Trivial task that can be automatically performed using code generators class class Student Student {{ 19/59

20 Class Diagram to Code class class Student Student {{ private private String String name; name; void void setname setname (String (String name){ name){ this.name this.name = = name; name; String String getname getname ((){){ return return name name ;; 20/59

21 Class Diagram to Code class class Student Student { { private private String String name name ; ; void void setname setname (String (String name){ name){ if if (name (name == == null) null) { { throw throw new new IllegalArgumentException("Student.name IllegalArgumentException("Student.name must must not not be be null!"); null!"); this.name this.name = = name; name; /59

22 class class Student Student {{ private private University University university; university; void void setuniversity setuniversity (University (University university) university) {{ this.university this.university = = university; university; University University getuniversity() getuniversity() {{ return return university; university; /59

23 import import java.util.hashset; java.util.hashset; class class Course Course { { private private HashSet<Student> HashSet<Student> students students = = new new HashSet<Student>( HashSet<Student>( ); ); void void addstudent addstudent (Student (Student student){ student){ students.add students.add (student) (student) ; ; void void removestudent removestudent (Student (Student student) student) { { students.remove students.remove (student) (student) ; ; HashSet<Student> HashSet<Student> getstudents getstudents ( ( ){ ){ return return students; students; 23/59

24 UML to Code: Directed Association import java.util.hashset; class Course { private HashSet<Student> students = new HashSet<Student>( ); void addstudent (Student student){ students.add (student) ; void removestudent (Student student) { students.remove (student) ; HashSet<Student> getstudents ( ){ return students; 24/59 Although the accessor methods aim for protecting the container object from arbitrary outside modications, this goal isn't reached. Possible callers can still do the following: mycourse.getstudents().clear();

25 Courses Courses course course =....; ; course.getstudents course.getstudents (().clear ).clear( () ); ; course.getstudents course.getstudents (().add ).add(new EvilStudent EvilStudent (() )); ; // // now now all all student student references references are are gone gone // // possible possible parameter parameter check check of of addstudent addstudent (()) is is skipped! skipped! 25/59

26 import import java.util.collections; java.util.collections; import import java.util.hashset; java.util.hashset; import import java.util.set; java.util.set; class class Course{ Course{ private private Set<Student> Set<Student> students students = = new new HashSet<Student> HashSet<Student> ( ( ); ); boolean boolean addstudent addstudent (Student (Student student){ student){ return return students.add students.add (student); (student); boolean boolean removestudent removestudent (Student (Student student){ student){ return return students.remove students.remove (student) (student) ; ; Set<Student> Set<Student> getstudents getstudents ( ( ){ ){ // don't expose the concrete container class // don't expose the concrete container class return return Collections.unmodifiableSet Collections.unmodifiableSet (students) (students) ; ; int int sizeofstudents sizeofstudents ( ( ){ ){ return return students.size students.size ( ( ); ); 26/59

27 UML to Code: Bidirectional Associations Because both these references belong to the same association, we have to ensure that they're pointing to the opposite object (integrity). It would be an inconsistent implementation state, when a course refers lecture hall, but this lecture hall instance refers a completely different course instance! Let's add some code that manages the references to match. 27/59

28 class class LectureHall LectureHall { { private private Course Course course; course; void void setcourse setcourse (Course (Course course){ course){ if if (this.course (this.course!=!= course course ){ ){ Course Course oldvalue oldvalue = = this.course; this.course; this.course this.course = = course; course; if if (oldvalue (oldvalue!=!= null) null) { { oldvalue.setlecturehall(null); oldvalue.setlecturehall(null); if if (course (course!=!= null) null) { { course.setlecturehall(this); course.setlecturehall(this); /59

29 Same for the Course class class class Course Course { { private private LectureHall LectureHall lecturehall; lecturehall; void void setlecturehall setlecturehall (LectureHall (LectureHall lecturehall){ lecturehall){ if if (this.lecturehall (this.lecturehall!=!= lecturehall lecturehall ){ ){ LectureHall LectureHall oldvalue oldvalue = = this.lecturehall; this.lecturehall; this.lecturehall this.lecturehall = = lecturehall; lecturehall; if if (oldvalue (oldvalue!=!= null) null) { { oldvalue.setcourse(null); oldvalue.setcourse(null); if if (lecturehall (lecturehall!=!= null) null) { { lecturehall.setcourse(this); lecturehall.setcourse(this); /59

30 Methods and Initialization UML describes the static class structure Also class attributes and encapsulation Moving towards capturing behavior we introduce methods to initialize the dynamic objects structure from classes Starting from the static main method and continuing in the class constructors We again use the Storyboard as a base 30/59

31 Example A good start could be: class University { University ( ) { // more code or method calls goes here static void main ( String [ ] args ) { University uni = new University() ; // init rooms/lectures Uni.loadStudents(); // init students... 31/59

32 Example 32/59

33 Methods and Initialization Very straightforward Basically it is just a recreation of the structure shown on the object diagrams 33/59

34 Algorithm Design The most challenging task How application should solve the problem? Deriving general rules how things work Example: Newton derived the physical laws of gravitation from recognizing an apple falling from a tree Algorithm Design is not a modeling task 34/59

35 Algorithm Design However, the Storyboard can help you out: Get a common algorithm skeleton: developer needs to follow the behavior captured in the Storyboard starting from the initialization and divide each step to the sequence of simple subtasks simulating the computer's view Important to keep an eye on the initialized and reachable objects Use that skeleton to derive general rules: whether this operation (set of operations) works only for the given situation or whether it is a general operation that works in many/all situations

36 Example 1.The student Karli wants to achieve a degree at the Study- Right University. For a degree we need at the moment 214 credit points and Karli starts with 0 credit points and 214 motivation points. Karli is outside of the university and now enters the university into the math class. 2. Karli attends the math lecture and automatically earns 17 credit points for it and loses at the same time 17 motivation points. Karli has now 17 credit points and 197 motivation points. 3. Karli attends the modeling lecture and receives 29 credit points and loses 29 motivation points. Karli has now studied math and modeling and therefor has now 46 credit points and 168 motivation points /59

37 Example 1.Enter the university (get to the first room, initialization) 2.Execute room activity 3.Choose the next room 4.Enter the room 5.Execute room activity 6... Main logic here 37/59

38 Amending Storyboard Let storyboard be a center of the modeling process Add comments to the scenario steps to highlight general behavior Add comments to point to the specific cases Add comments to clarify behavior with the customer 38/59

39 Story-Driven Modeling Method Overview Customer Interaction Scenarios Object Diagrams Customer Interaction Storyboards UML Class Diagram Classes Attributes Initialization Methods Algorithm Design * C O D E * C O D E * C O D E * C O D E *

40 Interaction with Customer and Tests Interaction with customer is continuous and aimed to concretize the application behavior Continuous improvement of the Storyboard Storyboards can very easily be adapted to tests Story-Driven Modeling is very close to the Test-Driven Modeling *

41 GUI Design with SDM

42 Example Application Imagine a party/social where participants would like to split the bill very exactly. this behavior is strangely referred to as going dutch in English Imagine that only several people have time to go and really buy something. Usually this ends up with one person who takes on the task of creating a register of all stuff brought, how much people spent on it, and computing and redistributing the money to even it out. Therefore, we will call our application the Group register. 42/59

43 Wireframes or Mockups 43/59

44 Wireframes or Mockups Often created manually on paper For customer it is difficult to differentiate GUI elements of editor from the designed application Often GUI is refined together with customer who is often missing design app. skills Designers vs Developers Usability vs code complexity 44/59

45 1. Karli, Bobby, and Olga agree to have a pot luck barbeque, but want to share the cost evenly. On the day of the barbeque, Karli brings his notebook running the Group Register application. He assumes that Bobby and Olga will bring enough for them all, so he does not bring any food items. After starting the application it shows the initial screen of the application with no entries. This step mentions that we have an application with an initial screen

46 2. Karli adds himself, Bobby, and Olga to the list of participants This step mentions a list of participants. Therefore we need a list showing the names of the participants. But how we will actually get the participants into the list? 46/59

47 A B C

48 a) Just editing the table *This requires complex handling of a single dummy line in the end of the table and might pose some difficulties in programming b) Having some fields and an add button underneath to enter one person at a time c) An add button on top which creates an empty line, which is editable * Combined idea from a) and b) but still needs more programming than b) Lets say that customer agreed decision b) 48/59

49 3. Bobby shows up and brings some beer for 12 EUR. Karli enters that Bobby brought beer for 12 EUR into the system. Olga brings bread for 4.50 EUR and salad for 3.00 EUR. Karli enters the items for Bobby and Karli to the system. From this step, we can derive that we need something to store bought items, the person who bought it, and the price of each. This also suggests to use some kind of table with the columns person name, item description, and price. Also here, we could discuss different options to fill in the values like in the last step, but also here we will settle on the option of adding some entry fields and an add button. This could be done in a different window, but we will put it in the same to make all information visible at all 49/59

50 50/59

51 4. The food items sum up to EUR. Therefore, the share of each participants equals to 6.50 EUR. As Karli has not spent any money for food items, he has to pay the full share of 6.50 EUR. As Bobby has already spent 12 EUR, he has to receive back 5.50 EUR. Olga has spent 7.50, so she has to receive 1 EUR back. So far we have not taken into account that we want to also see the amounts of the balance each participant has to pay to the register. We could now either add a button to compute the balance and show a different window with the results or we could also show the balance all the time in the participant's list. Let us assume that our potential customer prefers the version seeing the balance all the time. We therefore add a column Amounts.

52 52/59

53 Refining the Storyboard Further playing with these wireframes might lead to some further requirements and ideas Will it be possible to remove items from the list? How exactly? Will it be possible to edit the names of the participants? Client might discover that he needs to be able to adjust the price of the food items /59

54 Choosing the Right Container Class java.util.set java.util.hashset java.util.treeset 54/59

55 Choosing the Right Container Class java.util.set java.util.hashset java.util.treeset java.util.list java.util.arraylist java.util.linkedlist java.util.vector 55/59

56 Choosing the Right Container Class java.util.set java.util.hashset java.util.treeset java.util.list java.util.arraylist java.util.linkedlist java.util.vector java.util.map 56/59

57 Course Project Develop a desktop multiplayer version of the game Backgammon using Story-Driven Modelling method You can see an example implementation Wikipedia has a compact description Taken from: 57/59

58 Project Documentation The project report you will have to hand in has to consist of: A guide through your project (and repository) Code + compiled executable Your project plan (scheduler, requirements, aims..) Project log (progress) Class Diagram (+explanations of your decisions) Storyboard (as detailed as reasonable) Also simulate customer discussion, try to find/think out 3-5 additional features 58/59

59 Project Presentation The deadline for the assignment is (23:59) Submit as zip file on the website Course project presentations (10-15 min) on 16.10,17.10,18.10 (lab sessions) Talk about solved/not solved problems How you organized the work Some notes about the SDM method Application demo 59/59

System Modelling. Lecture

System Modelling. Lecture System Modelling Lecture 25.10.2011 Lecture Objectives GUI design with Story-Driven Modelling Class Diagram to Code (revistited) Automatic Code Generation Intro to project Mancala game: 35pts Wireframes

More information

CS112 Lecture: Defining Classes. 1. To describe the process of defining an instantiable class

CS112 Lecture: Defining Classes. 1. To describe the process of defining an instantiable class CS112 Lecture: Defining Classes Last revised 2/3/06 Objectives: 1. To describe the process of defining an instantiable class Materials: 1. BlueJ SavingsAccount example project 2. Handout of code for SavingsAccount

More information

CS112 Lecture: Defining Instantiable Classes

CS112 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 information

Lecture 8: Iterators and More Mutation

Lecture 8: Iterators and More Mutation Integrated Introduction to Computer Science Fisler, Nelson Contents 1 Traversing Lists 1 2 Motivating Iterators 2 3 Writing an Iterator 3 4 Writing Sum with an Iterator 4 Objectives By the end of this

More information

CSE 70 Final Exam Fall 2009

CSE 70 Final Exam Fall 2009 Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15

More information

CS445 Week 9: Lecture

CS445 Week 9: Lecture CS445 Week 9: Lecture Objectives: To discuss the solution of the midterm and answer any doubts about grading issues. Also, during the discussion, refresh the topics from the first part of the course. Reading

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

PA3: Violet's Vending Venture (Version 3.0)

PA3: Violet's Vending Venture (Version 3.0) CS 159: Programming Fundamentals James Madison University, Spring 2017 Semester PA3: Violet's Vending Venture (Version 3.0) Due Dates PA3-A: Wednesday, Feb. 22 at 11:00 pm PA3-A is a Canvas online readiness

More information

CPS122 Lecture: Detailed Design and Implementation

CPS122 Lecture: Detailed Design and Implementation CPS122 Lecture: Detailed Design and Implementation Objectives: Last revised March 12, 2012 1. To introduce the use of a complete UML class box to document the name, attributes, and methods of a class 2.

More information

TOOLS AND TECHNIQUES FOR TEST-DRIVEN LEARNING IN CS1

TOOLS AND TECHNIQUES FOR TEST-DRIVEN LEARNING IN CS1 TOOLS AND TECHNIQUES FOR TEST-DRIVEN LEARNING IN CS1 ABSTRACT Test-Driven Development is a design strategy where a set of tests over a class is defined prior to the implementation of that class. The goal

More information

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT. Object Oriented Programming

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT. Object Oriented Programming BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT Object Oriented Programming Examiner s Report March 2017 A1. a) Explain what is meant by the following terms:

More information

Inf1-OP. Inf1-OP Exam Review. Timothy Hospedales, adapting earlier version by Perdita Stevens and Ewan Klein. March 20, School of Informatics

Inf1-OP. Inf1-OP Exam Review. Timothy Hospedales, adapting earlier version by Perdita Stevens and Ewan Klein. March 20, School of Informatics Inf1-OP Inf1-OP Exam Review Timothy Hospedales, adapting earlier version by Perdita Stevens and Ewan Klein School of Informatics March 20, 2017 Overview Overview of examinable material: Lectures Week 1

More information

Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time)

Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time) CSE 11 Winter 2017 Program Assignment #2 (100 points) START EARLY! Due: 9 February 2017 at 1159pm (2359, Pacific Standard Time) PROGRAM #2: DoubleArray11 READ THE ENTIRE ASSIGNMENT BEFORE STARTING In lecture,

More information

Inf1-OOP. OOP Exam Review. Perdita Stevens, adapting earlier version by Ewan Klein. March 16, School of Informatics

Inf1-OOP. OOP Exam Review. Perdita Stevens, adapting earlier version by Ewan Klein. March 16, School of Informatics Inf1-OOP OOP Exam Review Perdita Stevens, adapting earlier version by Ewan Klein School of Informatics March 16, 2015 Overview Overview of examinable material: Lectures Topics S&W sections Week 1 Compilation,

More information

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10 Mathematics/Science Department Kirkwood Community College Course Syllabus Computer Science CSC142 Bob Driggs Dean Cate Sheller Instructor 1/10 Computer Science (CSC142) Course Description Introduces computer

More information

Basic Object-Oriented Concepts. 5-Oct-17

Basic Object-Oriented Concepts. 5-Oct-17 Basic Object-Oriented Concepts 5-Oct-17 Concept: An object has behaviors In old style programming, you had: data, which was completely passive functions, which could manipulate any data An object contains

More information

COE318 Lecture Notes Week 8 (Oct 24, 2011)

COE318 Lecture Notes Week 8 (Oct 24, 2011) COE318 Software Systems Lecture Notes: Week 8 1 of 17 COE318 Lecture Notes Week 8 (Oct 24, 2011) Topics == vs..equals(...): A first look Casting Inheritance, interfaces, etc Introduction to Juni (unit

More information

Chapter 4 Defining Classes I

Chapter 4 Defining Classes I Chapter 4 Defining Classes I This chapter introduces the idea that students can create their own classes and therefore their own objects. Introduced is the idea of methods and instance variables as the

More information

EINDHOVEN UNIVERSITY OF TECHNOLOGY

EINDHOVEN UNIVERSITY OF TECHNOLOGY EINDHOVEN UNIVERSITY OF TECHNOLOGY Department of Mathematics & Computer Science Exam Programming Methods, 2IP15, Wednesday 17 April 2013, 09:00 12:00 TU/e THIS IS THE EXAMINER S COPY WITH (POSSIBLY INCOMPLETE)

More information

Note that if both p1 and p2 are null, equals returns true.

Note that if both p1 and p2 are null, equals returns true. 258 students took the exam. The average was 26.4 out of 36; the median was 27.5; scores ranged from 3 to 35.5. 133 students scored between 27.5 and 36, 99 between 18.5 and 27, 24 between 9.5 and 18, and

More information

CMSC 433 Section 0101 Fall 2012 Midterm Exam #1

CMSC 433 Section 0101 Fall 2012 Midterm Exam #1 Name: CMSC 433 Section 0101 Fall 2012 Midterm Exam #1 Directions: Test is closed book, closed notes. Answer every question; write solutions in spaces provided. Use backs of pages for scratch work. Good

More information

TREES. Tree Overview 9/28/16. Prelim 1 tonight! Important Announcements. Tree terminology. Binary trees were in A1!

TREES. Tree Overview 9/28/16. Prelim 1 tonight! Important Announcements. Tree terminology. Binary trees were in A1! //16 Prelim 1 tonight! :3 prelim is very crowded. You HAVE to follow these directions: 1. Students taking the normal :3 prelim (not the quiet room) and whose last names begin with A through Da MUST go

More information

CPS122 Lecture: Detailed Design and Implementation

CPS122 Lecture: Detailed Design and Implementation CPS122 Lecture: Detailed Design and Implementation Objectives: Last revised March 3, 2017 1. To introduce the use of a complete UML class box to document the name, attributes, and methods of a class 2.

More information

COE318 Lecture Notes Week 9 (Week of Oct 29, 2012)

COE318 Lecture Notes Week 9 (Week of Oct 29, 2012) COE318 Lecture Notes: Week 9 1 of 14 COE318 Lecture Notes Week 9 (Week of Oct 29, 2012) Topics The final keyword Inheritance and Polymorphism The final keyword Zoo: Version 1 This simple version models

More information

Midterms Save the Dates!

Midterms 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 information

Instance Method Development Demo

Instance Method Development Demo Instance Method Development Demo Write a class Person with a constructor that accepts a name and an age as its argument. These values should be stored in the private attributes name and age. Then, write

More information

Survey #2. Teen Talk Barbie TM Reloaded. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Partially Filled Arrays ArrayLists

Survey #2. Teen Talk Barbie TM Reloaded. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Partially Filled Arrays ArrayLists University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Partially Filled Arrays ArrayLists Do-It-Yourself ArrayLists Scope Static Readings This Week: Ch 8.3-8.8 and into Ch 9.1-9.3 (Ch

More information

MSO Lecture 1. Wouter Swierstra (adapted by HP) September 11, 2017

MSO Lecture 1. Wouter Swierstra (adapted by HP) September 11, 2017 1 MSO Lecture 1 Wouter Swierstra (adapted by HP) September 11, 2017 So you think you can program... 2 From nrc.nl 3 Question: why do ICT-projects fail so often? 4 5 Question: why do ICT-projects fail so

More information

Project Compiler. CS031 TA Help Session November 28, 2011

Project Compiler. CS031 TA Help Session November 28, 2011 Project Compiler CS031 TA Help Session November 28, 2011 Motivation Generally, it s easier to program in higher-level languages than in assembly. Our goal is to automate the conversion from a higher-level

More information

CMPT 126: Introduction to Computing Science and Programming Fall 2007, Harbour Centre

CMPT 126: Introduction to Computing Science and Programming Fall 2007, Harbour Centre CMPT 126: Introduction to Computing Science and Programming Fall 2007, Harbour Centre Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University July 27, 2011 Meeting Time and

More information

You must pass the final exam to pass the course.

You must pass the final exam to pass the course. Computer Science Technology Department Houston Community College System Department Website: http://csci.hccs.cc.tx.us CRN: 46876 978-1-4239-0146-4 1-4239-0146-0 Semester: Fall 2010 Campus and Room: Stafford

More information

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University

Lecture 3. COMP1006/1406 (the Java course) Summer M. Jason Hinek Carleton University Lecture 3 COMP1006/1406 (the Java course) Summer 2014 M. Jason Hinek Carleton University today s agenda assignments 1 (graded) & 2 3 (available now) & 4 (tomorrow) a quick look back primitive data types

More information

Comp Assignment 4: Extendible and Multi-Platform Object (De)Serialization

Comp Assignment 4: Extendible and Multi-Platform Object (De)Serialization Comp 734 - Assignment 4: Extendible and Multi-Platform Object (De)Serialization Date Assigned: October 24, 2013 Part 1 Completion Date: Tue Oct 29, 2013 Part 2 Target Date: Thu Oct 31, 2013 Part 2 and

More information

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10A OOP Fundamentals By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Definition Pointers vs containers Object vs primitives Constructors Methods Object class

More information

CIS 110 Introduction to Computer Programming Summer 2017 Final. Recitation # (e.g., 201):

CIS 110 Introduction to Computer Programming Summer 2017 Final. Recitation # (e.g., 201): CIS 110 Introduction to Computer Programming Summer 2017 Final Name: Recitation # (e.g., 201): Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania

More information

Technical basis. Interfaces. Framework and tool overview

Technical basis. Interfaces. Framework and tool overview Introduction - INF 5750 INF 5750 Technical basis Interfaces Three-layer architecture Framework and tool overview Interfaces What is it? Defines a contract with implementing classes Defines which h methods

More information

Course Syllabus. Programming Language Paradigms. Spring - DIS Copenhagen. Semester & Location: Elective Course - 3 credits.

Course Syllabus. Programming Language Paradigms. Spring - DIS Copenhagen. Semester & Location: Elective Course - 3 credits. Course Syllabus Programming Language Paradigms Semester & Location: Type & Credits: Spring - DIS Copenhagen Elective Course - 3 credits Major Disciplines: Faculty Members: Computer Science, Mathematics

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

TREES Lecture 12 CS2110 Fall 2016

TREES Lecture 12 CS2110 Fall 2016 TREES Lecture 12 CS2110 Fall 2016 Prelim 1 tonight! 2 5:30 prelim is very crowded. You HAVE to follow these directions: 1. Students taking the normal 5:30 prelim (not the quiet room) and whose last names

More information

Introduction to Software Engineering in Java. Exceptions, I/O, and you++

Introduction to Software Engineering in Java. Exceptions, I/O, and you++ 6.092 - Introduction to Software Engineering in Java Lecture 8: Exceptions, I/O, and you++ Thursday, January 31 IAP 2008 Cite as: Evan Jones, Olivier Koch, and Usman Akeju, course materials for 6.092 Introduction

More information

Lecture 5: Implementing Lists, Version 1

Lecture 5: Implementing Lists, Version 1 CS18 Integrated Introduction to Computer Science Fisler, Nelson Lecture 5: Implementing Lists, Version 1 Contents 1 Implementing Lists 1 2 Methods 2 2.1 isempty...........................................

More information

CS 170 Java Programming 1. Week 13: Classes, Testing, Debugging

CS 170 Java Programming 1. Week 13: Classes, Testing, Debugging CS 170 Java Programming 1 Week 13: Classes, Testing, Debugging What s the Plan? Short lecture for makeup exams Topic 1: A Little Review How to create your own user-defined classes Defining instance variables,

More information

Object Orientation. A Crash Course Intro

Object Orientation. A Crash Course Intro Object Orientation A Crash Course Intro What is an Object? An object, in the context of objectoriented programming, is the association of a state with a set of behaviors. State: its fields, or member variables

More information

Pieter van den Hombergh Thijs Dorssers Stefan Sobek. February 10, 2017

Pieter van den Hombergh Thijs Dorssers Stefan Sobek. February 10, 2017 Inheritance and Inheritance and Pieter van den Hombergh Thijs Dorssers Stefan Sobek Fontys Hogeschool voor Techniek en Logistiek February 10, 2017 /FHTenL Inheritance and February 10, 2017 1/45 Topics

More information

ECE 122. Engineering Problem Solving with Java

ECE 122. Engineering Problem Solving with Java ECE 122 Engineering Problem Solving with Java Lecture 17 Inheritance Overview Problem: Can we create bigger classes from smaller ones without having to repeat information? Subclasses: a class inherits

More information

A Java Execution Simulator

A Java Execution Simulator A Java Execution Simulator Steven Robbins Department of Computer Science University of Texas at San Antonio srobbins@cs.utsa.edu ABSTRACT This paper describes JES, a Java Execution Simulator that allows

More information

Survey #2. Variable Scope. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings. Scope Static.

Survey #2. Variable Scope. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. Readings. Scope Static. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Scope Static Readings This Week: Ch 8.3-8.8 and into Ch 9.1-9.3 (Ch 9.3-9.8 and Ch 11.1-11.3 in old 2 nd ed) (Reminder: Readings

More information

Problem and Solution Overview: An elegant task management solution, that saves busy people time.

Problem and Solution Overview: An elegant task management solution, that saves busy people time. An elegant task management solution, that saves busy people time. Team: Anne Aoki: Storyboarding, design, user studies, writing Alex Anderson: User studies, design Matt Willden: Ideation, writing, user

More information

The Stack, Free Store, and Global Namespace

The Stack, Free Store, and Global Namespace Pointers This tutorial is my attempt at clarifying pointers for anyone still confused about them. Pointers are notoriously hard to grasp, so I thought I'd take a shot at explaining them. The more information

More information

Student Performance Q&A:

Student Performance Q&A: Student Performance Q&A: 2004 AP Computer Science A Free-Response Questions The following comments on the 2004 free-response questions for AP Computer Science A were written by the Chief Reader, Chris

More information

TESTING AND DEBUGGING

TESTING AND DEBUGGING TESTING AND DEBUGGING zombie[1] zombie[3] Buuuuugs zombie[4] zombie[2] zombie[5] zombie[0] Fundamentals of Computer Science I Outline Debugging Types of Errors Syntax Errors Semantic Errors Logic Errors

More information

Pieter van den Hombergh Thijs Dorssers Stefan Sobek. January 11, 2018

Pieter van den Hombergh Thijs Dorssers Stefan Sobek. January 11, 2018 Inheritance and Inheritance and Pieter van den Hombergh Thijs Dorssers Stefan Sobek Java Inheritance Example I Visibility peekabo Constructors Fontys Hogeschool voor Techniek en Logistiek January 11, 2018

More information

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming

Object Oriented Programming is a programming method that combines: Advantage of Object Oriented Programming Overview of OOP Object Oriented Programming is a programming method that combines: a) Data b) Instructions for processing that data into a self-sufficient object that can be used within a program or in

More information

Guessing Game with Objects

Guessing Game with Objects Objectives Lab1: Guessing Game with Objects Guessing Game with Objects 1. Practice designing and implementing an object-oriented program. 2. Use Console I/O in Java. Tasks 1. Design the program (problem

More information

Tips from the experts: How to waste a lot of time on this assignment

Tips from the experts: How to waste a lot of time on this assignment Com S 227 Spring 2018 Assignment 1 100 points Due Date: Friday, September 14, 11:59 pm (midnight) Late deadline (25% penalty): Monday, September 17, 11:59 pm General information This assignment is to be

More information

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit. Com S 227 Fall 2017 Miniassignment 1 50 points Due Date: Monday, October 16, 11:59 pm (midnight) Late deadline (25% penalty): Tuesday, October 17, 11:59 pm General information This assignment is to be

More information

PREPARING FOR PRELIM 2

PREPARING FOR PRELIM 2 PREPARING FOR PRELIM 2 CS 1110: FALL 2012 This handout explains what you have to know for the second prelim. There will be a review session with detailed examples to help you study. To prepare for the

More information

OBJECTS AND CLASSES CHAPTER. Final Draft 10/30/2011. Slides by Donald W. Smith TechNeTrain.com

OBJECTS AND CLASSES CHAPTER. Final Draft 10/30/2011. Slides by Donald W. Smith TechNeTrain.com CHAPTER 8 OBJECTS AND CLASSES Slides by Donald W. Smith TechNeTrain.com Final Draft 10/30/2011 Chapter Goals To understand the concepts of classes, objects and encapsulation To implement instance variables,

More information

Developing Microsoft.NET Applications for Windows (Visual Basic.NET)

Developing Microsoft.NET Applications for Windows (Visual Basic.NET) Developing Microsoft.NET Applications for Windows (Visual Basic.NET) Course Number: 2555 Length: 1 Day(s) Certification Exam This course will help you prepare for the following Microsoft Certified Professional

More information

CSCI 1301: Introduction to Computing and Programming Spring 2019 Lab 10 Classes and Methods

CSCI 1301: Introduction to Computing and Programming Spring 2019 Lab 10 Classes and Methods Note: No Brainstorm this week. This lab gives fairly detailed instructions on how to complete the assignment. The purpose is to get more practice with OOP. Introduction This lab introduces you to additional

More information

Computer Science E-119 Fall Problem Set 4. Due prior to lecture on Wednesday, November 28

Computer Science E-119 Fall Problem Set 4. Due prior to lecture on Wednesday, November 28 Computer Science E-119 Fall 2012 Due prior to lecture on Wednesday, November 28 Getting Started To get the files that you will need for this problem set, log into nice.harvard.edu and enter the following

More information

Survey #2. Programming Assignment 3. Final Exam. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu.

Survey #2. Programming Assignment 3. Final Exam. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu. University of British Columbia CPSC 111, Intro to Computation Alan J. Hu Accessing the Superclass Object Hierarchies is-a, has-a Readings This Week: Ch 9.4-9.5 and into Ch 10.1-10.8 (Ch 11.4-11.5 and into

More information

CS Week 13. Jim Williams, PhD

CS Week 13. Jim Williams, PhD CS 200 - Week 13 Jim Williams, PhD This Week 1. Team Lab: Instantiable Class 2. BP2 Strategy 3. Lecture: Classes as templates BP2 Strategy 1. M1: 2 of 3 milestone tests didn't require reading a file. 2.

More information

CS1004: Intro to CS in Java, Spring 2005

CS1004: Intro to CS in Java, Spring 2005 CS1004: Intro to CS in Java, Spring 2005 Lecture #23: OO Design, cont d. Janak J Parekh janak@cs.columbia.edu Administrivia HW#5 due Tuesday And if you re cheating on (or letting others see your) HW#5

More information

Inheritance and Interfaces

Inheritance and Interfaces Inheritance and Interfaces Object Orientated Programming in Java Benjamin Kenwright Outline Review What is Inheritance? Why we need Inheritance? Syntax, Formatting,.. What is an Interface? Today s Practical

More information

1 Inheritance (8 minutes, 9 points)

1 Inheritance (8 minutes, 9 points) Name: Career Account ID: Recitation#: 1 CS180 Spring 2011 Exam 2, 6 April, 2011 Prof. Chris Clifton Turn Off Your Cell Phone. Use of any electronic device during the test is prohibited. Time will be tight.

More information

Day 3. COMP 1006/1406A Summer M. Jason Hinek Carleton University

Day 3. COMP 1006/1406A Summer M. Jason Hinek Carleton University Day 3 COMP 1006/1406A Summer 2016 M. Jason Hinek Carleton University today s agenda assignments 1 was due before class 2 is posted (be sure to read early!) a quick look back testing test cases for arrays

More information

ITCertMaster. Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way!

ITCertMaster.  Safe, simple and fast. 100% Pass guarantee! IT Certification Guaranteed, The Easy Way! ITCertMaster Safe, simple and fast. 100% Pass guarantee! Exam : 1z0-853 Title : Java Standard Edition 5 Programmer Certified Professional Exam Vendor : Oracle Version : DEMO Get Latest & Valid 1Z0-853

More information

Example: Fibonacci Numbers

Example: Fibonacci Numbers Example: Fibonacci Numbers Write a program which determines F n, the (n + 1)-th Fibonacci number. The first 10 Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8, 13, 21, and 34. The sequence of Fibonacci numbers

More information

Designing a Database -- Understanding Relational Design

Designing a Database -- Understanding Relational Design Designing a Database -- Understanding Relational Design Contents Overview The Database Design Process Steps in Designing a Database Common Design Problems Determining the Purpose Determining the Tables

More information

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics COMP-202 Unit 1: Introduction Announcements Did you miss the first lecture? Come talk to me after class. If you want

More information

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING

BCS THE CHARTERED INSTITUTE FOR IT. BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING BCS THE CHARTERED INSTITUTE FOR IT BCS HIGHER EDUCATION QUALIFICATIONS BCS Level 5 Diploma in IT OBJECT ORIENTED PROGRAMMING Wednesady 23 rd March 2016 Afternoon Answer any FOUR questions out of SIX. All

More information

Department of Civil and Environmental Engineering, Spring Semester, ENCE 688R: Final Exam: 2 Hours, Open Book and Open Notes

Department of Civil and Environmental Engineering, Spring Semester, ENCE 688R: Final Exam: 2 Hours, Open Book and Open Notes Department of Civil and Environmental Engineering, Spring Semester, 2017 ENCE 688R: Final Exam: 2 Hours, Open Book and Open Notes Name : Question Points Score 1 50 2 30 3 20 Total 100 1 Question 1: 50

More information

UNIT 3 ARRAYS, RECURSION, AND COMPLEXITY CHAPTER 11 CLASSES CONTINUED

UNIT 3 ARRAYS, RECURSION, AND COMPLEXITY CHAPTER 11 CLASSES CONTINUED UNIT 3 ARRAYS, RECURSION, AND COMPLEXITY CHAPTER 11 CLASSES CONTINUED EXERCISE 11.1 1. static public final int DEFAULT_NUM_SCORES = 3; 2. Java allocates a separate set of memory cells in each instance

More information

Data Structures (list, dictionary, tuples, sets, strings)

Data Structures (list, dictionary, tuples, sets, strings) Data Structures (list, dictionary, tuples, sets, strings) Lists are enclosed in brackets: l = [1, 2, "a"] (access by index, is mutable sequence) Tuples are enclosed in parentheses: t = (1, 2, "a") (access

More information

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012

MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012 MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #1 Examination 12:30 noon, Tuesday, February 14, 2012 Instructor: K. S. Booth Time: 70 minutes (one hour ten minutes)

More information

CSSE 220. Coupling and Cohesion Scoping. Please checkout VideoStore from your SVN

CSSE 220. Coupling and Cohesion Scoping. Please checkout VideoStore from your SVN CSSE 220 Coupling and Cohesion Scoping Please checkout VideoStore from your SVN The plan Learn 3 essential object oriented design terms: Encapsulation (done) Coupling Cohesion Scope (if we have time) Coupling

More information

COP 3330 Final Exam Review

COP 3330 Final Exam Review COP 3330 Final Exam Review I. The Basics (Chapters 2, 5, 6) a. comments b. identifiers, reserved words c. white space d. compilers vs. interpreters e. syntax, semantics f. errors i. syntax ii. run-time

More information

ASSIGNMENT 5 Objects, Files, and More Garage Management

ASSIGNMENT 5 Objects, Files, and More Garage Management ASSIGNMENT 5 Objects, Files, and More Garage Management COMP-202B, Winter 2010, All Sections Due: Wednesday, April 14, 2009 (23:55) You MUST do this assignment individually and, unless otherwise specified,

More information

Fall 2013 Program/Homework Assignment #2 (100 points) -(Corrected Version)

Fall 2013 Program/Homework Assignment #2 (100 points) -(Corrected Version) CSE 11 START EARLY! Fall 2013 Program/Homework Assignment #2 (100 points) -(Corrected Version) Due: 11 October 2013 at 11pm (2300) Book Exercises Cover Chapters: 3-4 This is a combination of written responses

More information

Software Engineering I (02161)

Software Engineering I (02161) Software Engineering I (02161) Week 1 Assoc. Prof. Hubert Baumeister DTU Compute Technical University of Denmark Spring 2016 Contents Course Introduction Introduction to Software Engineering Practical

More information

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7

Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7 Computer Science 2 Lecture 4 Inheritance: Trinidad Fruit Stand 02/15/2014 Revision : 1.7 1 Problem Ralph owns the Trinidad Fruit Stand that sells its fruit on the street, and he wants to use a computer

More information

02 Features of C#, Part 1. Jerry Nixon Microsoft Developer Evangelist Daren May President & Co-founder, Crank211

02 Features of C#, Part 1. Jerry Nixon Microsoft Developer Evangelist Daren May President & Co-founder, Crank211 02 Features of C#, Part 1 Jerry Nixon Microsoft Developer Evangelist Daren May President & Co-founder, Crank211 Module Overview Constructing Complex Types Object Interfaces and Inheritance Generics Constructing

More information

Introduction INF 5750

Introduction INF 5750 Introduction - INF 5750 INF 5750 Technical basis Interfaces Three-layer architecture Framework and tool overview Interfaces What is it? Defines a contract with implementing classes Defines which methods

More information

User Interfaces Assignment 3: Heuristic Re-Design of Craigslist (English) Completed by Group 5 November 10, 2015 Phase 1: Analysis of Usability Issues Homepage Error 1: Overall the page is overwhelming

More information

CSCU9T4: Managing Information

CSCU9T4: Managing Information CSCU9T4: Managing Information CSCU9T4 Spring 2016 1 The Module Module co-ordinator: Dr Gabriela Ochoa Lectures by: Prof Leslie Smith (l.s.smith@cs.stir.ac.uk) and Dr Nadarajen Veerapen (nve@cs.stir.ac.uk)

More information

CAT.woa/wa/assignments/eclipse

CAT.woa/wa/assignments/eclipse King Saud University College of Computer & Information Science CSC111 Lab10 Arrays II All Sections ------------------------------------------------------------------- Instructions Web-CAT submission URL:

More information

EL2310 Scientific Programming

EL2310 Scientific Programming Lecture 14: Object Oriented Programming in C++ (ramviyas@kth.se) Overview Overview Lecture 14: Object Oriented Programming in C++ Classes (cont d) More on Classes and Members Group presentations Last time

More information

Code Reuse: Inheritance

Code Reuse: Inheritance Object-Oriented Design Lecture 14 CSU 370 Fall 2008 (Pucella) Tuesday, Nov 4, 2008 Code Reuse: Inheritance Recall the Point ADT we talked about in Lecture 8: The Point ADT: public static Point make (int,

More information

COMP-202 Unit 9: Exceptions

COMP-202 Unit 9: Exceptions COMP-202 Unit 9: Exceptions Announcements - Assignment 4: due Monday April 16th - Assignment 4: tutorial - Final exam tutorial next week 2 Exceptions An exception is an object that describes an unusual

More information

CS 6371: Advanced Programming Languages

CS 6371: Advanced Programming Languages CS 6371: Advanced Programming Languages Dr. Kevin Hamlen Spring 2017 Fill out, sign, and return prereq forms: Course number: CS 6371 Section: 1 Prerequisites: CS 5343: Algorithm Analysis & Data Structures

More information

CSc 328, Spring 2004 Final Examination May 12, 2004

CSc 328, Spring 2004 Final Examination May 12, 2004 Name: CSc 328, Spring 2004 Final Examination May 12, 2004 READ THIS FIRST Fill in your name above. Do not turn this page until you are told to begin. Books, and photocopies of pages from books MAY NOT

More information

CIS 110 Fall 2014 Introduction to Computer Programming 8 Oct 2014 Midterm Exam Name:

CIS 110 Fall 2014 Introduction to Computer Programming 8 Oct 2014 Midterm Exam Name: CIS 110 Fall 2014 Introduction to Computer Programming 8 Oct 2014 Midterm Exam Name: Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the University

More information

CS 1653: Applied Cryptography and Network Security Fall Term Project, Phase 2

CS 1653: Applied Cryptography and Network Security Fall Term Project, Phase 2 CS 1653: Applied Cryptography and Network Security Fall 2017 Term Project, Phase 2 Assigned: Tuesday, September 12 Due: Tuesday, October 3, 11:59 PM 1 Background Over the course of this semester, we will

More information

CSC207 Week 3. Larry Zhang

CSC207 Week 3. Larry Zhang CSC207 Week 3 Larry Zhang 1 Announcements Readings will be posted before the lecture Lab 1 marks available in your repo 1 point for creating the correct project. 1 point for creating the correct classes.

More information

Initial Coding Guidelines

Initial Coding Guidelines Initial Coding Guidelines ITK 168 (Lim) This handout specifies coding guidelines for programs in ITK 168. You are expected to follow these guidelines precisely for all lecture programs, and for lab programs.

More information

MechEng SE3 Lecture 7 Domain Modelling

MechEng SE3 Lecture 7 Domain Modelling MechEng SE3 Lecture 7 Domain Modelling Simon Gay (slides by Phil Gray) 17 February 2010 1 This week s supplementary reading Zero Balances and Zero Responsibility Michael Bolton http://www.developsense.com/essays/zero.html

More information

Object Oriented Relationships

Object Oriented Relationships Lecture 3 Object Oriented Relationships Group home page: http://groups.yahoo.com/group/java CS244/ 2 Object Oriented Relationships Object oriented programs usually consisted of a number of classes Only

More information

ASSIGNMENT 5 Objects, Files, and a Music Player

ASSIGNMENT 5 Objects, Files, and a Music Player ASSIGNMENT 5 Objects, Files, and a Music Player COMP-202A, Fall 2009, All Sections Due: Thursday, December 3, 2009 (23:55) You MUST do this assignment individually and, unless otherwise specified, you

More information