Objects OOP Quiz Stuff. CS1101S: DG Week 10. Wohoo, OOP! October 22, CS1101S: DG Week 10

Size: px
Start display at page:

Download "Objects OOP Quiz Stuff. CS1101S: DG Week 10. Wohoo, OOP! October 22, CS1101S: DG Week 10"

Transcription

1 Wohoo,! October 22, 2016

2 Revision 1 Objects 2 3

3 What is an Object? Objects Revision Tables that map keys to values Efficient data structure than using lists Three notations: square bracket, dot-nation and literal Order of growth (runtime) for accessing and updating an entry? Θ(1)! Things to put in object entry! Functions: obj["a"] = function(x) { }; Strings: obj["b"] = "bbq"; Variables: obj["c"] = my_pair; What happens when we change the value of my_pair?

4 Problem One: Drawing! Revision Question Following the notation introduced in Lecture 9B, draw a graphical representation of the two objects my_object and my_other_object. For Your Reference var my_object = {}; my_object["a"] = 1; my_object["b"] = 2; my_object["my very long key"] = 2; var my_other_object = { d : 1, e : "a string", f : true, my_fun : function (x) {} };

5 Problem One: Solution Objects Revision my_object & my_other_object

6 Problem Two: Some Play Revision Question Familiarize yourself with the object notation, by assigning the variable theatre_play to an object with the attributes title, number_of_spectators, venue, and number_of_actors, using the three different syntactic variants: Square bracket notation, dot-notation and literal object creation. You can use as values the data from the last theatre play that you watched. Any theatre goers?

7 Problem Two: Solution Objects Revision Square bracket notation var theatre_play = {}; theatre_play["title"] = "a Play featuring an iphone power block and a mechanical pencil"; theatre_play["number_of_spectators"] = ; theatre_play["venue"] = "M8izj_mKa-8"; theatre_play["number_of_actors"] = 2;

8 Revision Problem Two: Solution (continued) Dot-notation var theatre_play = {}; theatre_play.title = "a Play featuring an iphone power block and a mechanical pencil"; theatre_play.number_of_spectators = ; theatre_play.venue = "M8izj_mKa-8"; theatre_play.number_of_actors = 2;

9 Revision Problem Two: Solution (continued) Literal var theatre_play = { title: "a Play featuring an iphone power block and a mechanical pencil", number_of_spectators: , venue: "M8izj_mKa-8", number_of_actors: 2 };

10 Problem Three: More drawing! Revision Question Draw a graphical representation for x, y, z after evaluating the following programs. var x = pair(1, my_object); var y = {q: 4, p: theatre_play}; var z = my_object; z.play = pair(theatre_play, theatre_play);

11 Problem Three: Solution Revision Unified diagram!

12 Review What is Object Oriented Programming? System is organized around objects that receive messages An object encapsulates data (state) and operations (behaviour) Major Concepts Classes and instances Methods and message passing Inheritance Polymorphism

13 Review Problem One: DRAW AGAIN?!!? Question Draw the box-and-pointer diagrams of the objects Vessel, ContainerShip, my_boat, my_ship that result from evaluating the following program.

14 Problem One: Solution Objects Review Diagram :(

15 Problem Two: Buying Ships Review Question Construct these objects without using a single. and without using new. After evaluating your program, the following program should work as expected. Hint Dot-notation is out. What about literal and square bracket notation?

16 Problem Two: Solution Objects Review Literal Version var my_boat = { displacement: 20, proto : Vessel["prototype"] }; var my_ship = { displacement: 500, containers: list("c1", "c2"), proto : ContainerShip["prototype] };

17 Review Problem Two: Solution (continued) Square bracket Version var my_boat = {}; my_boat["displacement"] = 20; my_boat[" proto "] = Vessel["prototype"]; var my_ship = {}; my_boat["displacement"] = 500; my_boat["containers"] = list("c1", "c2"); my_boat[" proto "] = ContainerShip["prototype"];

18 Review Problem One (reset): Gorilla or Student? Question Now lets create a student object named Harambe. Since Harambe was a little sick on exam day, he didnt perform well and got an exam score of 45. After the creation of the student object, verify all the attribute values of Harambe and then make Harambe introduce himself. Why does it work? Solution var harambe = new Student("Harambe", 45); harambe.introduce_self(); Why? Consider where the variables are stored!

19 Problem Two: Gorilla with IQ Review Question After some time, the professor realized that he had made a mistake in the grading, and Harambes exam score was amended to 60. Update Harambes exam score to 60, and verify again all the attribute values of Harambe. Is there anything wrong? Solution Change score: harambe.exam_score = 60; Why? Check if we are assigning a value or an expression?

20 Review Problem Three: Recording System PRO Question To fix the problem above, lets add to the Student class a method called update_score, which updates the students module grade and mood based on a given score.

21 Problem Three: Solution Review Solution Student.prototype.update_score = function (new_score) { this.exam_score = new_score; this.module_grade = this.exam_score < 50? "C" : this.exam_score <= 75? "B" : "A"; this.mood = this.module_grade === "C"? "still happy because I can..." : "happy"; };

22 Problem Four: Introduction? Review Question We now want to change the students way of introducing himself/herself such that he/she also introduces himself/herself as a student. We try to achieve this by adding these lines: Student.introduce_self = function(){ display("hello, my name is " + this.name +" and my mood is " + this.mood); display("i am also a student!"); }; Try letting Harambe introduce himself again. Is there any difference? Why?

23 Problem Four: Solution Review Why? Differences between prototype and instance variables.

24 Problem Five: Irritating Objects Review Question Correct the above problem so that a student can introduce himself/herself as a student. Can Harambe now introduce himself correctly? Will it still work if we define introduce_self in Student.prototype? Why? Solution It will work. It is due to how a function call is processed by the interpreter (using proto )

25 Problem One Eh: Flip/Flop Question Define a function flip (with no parameters) that returns 1 the first time it is called, 0 the second time it is called, 1 the third time, 0 the fourth time, and so on. Answer function make_flip() { var state = 0; return function() { state = (state === 1)? 0 : 1; return state; }; } var flip = make_flip();

26 Problem One Bee: FlipFactory Question Define a class Flip that can be used to generate flip objects. That is, we should be able to write var flip = new Flip(); Define a constructor Flip and a method flip. The first time you invoke the method flip on a Flip object, it returns 1, the second time 0, the third time 1, and so on.

27 Problem One Bee: Solution Solution function Flip() { this.state = 0; } Flip.prototype.flip = function() { this.state = (this.state === 1)? 0 : 1; return this.state; };

JavaScript: the language of browser interactions. Claudia Hauff TI1506: Web and Database Technology

JavaScript: the language of browser interactions. Claudia Hauff TI1506: Web and Database Technology JavaScript: the language of browser interactions Claudia Hauff TI1506: Web and Database Technology ti1506-ewi@tudelft.nl Densest Web lecture of this course. Coding takes time. Be friendly with Codecademy

More information

University of Massachusetts Lowell

University of Massachusetts Lowell University of Massachusetts Lowell 91.301: Organization of Programming Languages Fall 2002 Quiz 1 Solutions to Sample Problems 2 91.301 Problem 1 What will Scheme print in response to the following statements?

More information

Midterm Exam #2 Review. CS 2308 :: Spring 2016 Molly O'Neil

Midterm Exam #2 Review. CS 2308 :: Spring 2016 Molly O'Neil Midterm Exam #2 Review CS 2308 :: Spring 2016 Molly O'Neil Midterm Exam #2 Wednesday, April 13 In class, pencil & paper exam Closed book, closed notes, no cell phones or calculators, clean desk 20% of

More information

Today. Continue our very basic intro to JavaScript. Lambda calculus

Today. Continue our very basic intro to JavaScript. Lambda calculus JavaScript (cont) Today Continue our very basic intro to JavaScript Lambda calculus Last lecture recap JavaScript was designed in 10 days Lots of unsatisfactory parts (in retrospect); many due due to the

More information

Sample CS 142 Midterm Examination

Sample CS 142 Midterm Examination Sample CS 142 Midterm Examination Spring Quarter 2016 You have 1.5 hours (90 minutes) for this examination; the number of points for each question indicates roughly how many minutes you should spend on

More information

JAVA MOCK TEST JAVA MOCK TEST II

JAVA MOCK TEST JAVA MOCK TEST II http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your

More information

1LIVE CHESS BOOK User Manual

1LIVE CHESS BOOK User Manual 1LIVE CHESS BOOK User Manual Q.1] System Requirements - The software works on windows 7, windows 8, and windows 10 platform. - Please ensure that your speaker of PC/ Laptop is in proper working condition,

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 43 Dynamic Binding (Polymorphism): Part III Welcome to Module

More information

Performance Assessment Spring 2001

Performance Assessment Spring 2001 Cover Page of Exam Mathematics Assessment Collaborative Course Grade Two 3 Performance Assessment Spring 2001 District's Student Id # District's Student Id # District's Student Id # (Option: District District's

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

CSCI-1200 Data Structures Fall 2009 Lecture 25 Concurrency & Asynchronous Computing

CSCI-1200 Data Structures Fall 2009 Lecture 25 Concurrency & Asynchronous Computing CSCI-1200 Data Structures Fall 2009 Lecture 25 Concurrency & Asynchronous Computing Final Exam General Information The final exam will be held Monday, Dec 21st, 2009, 11:30am-2:30pm, DCC 308. A makeup

More information

OOP-8-DLList-1-HW.docx CSCI 2320 Initials Page 1

OOP-8-DLList-1-HW.docx CSCI 2320 Initials Page 1 OOP-8-DLList-1-HW.docx CSCI 2320 Initials Page 1 If this lab is an Individual assignment, you must do all coded programs on your own. You may ask others for help on the language syntax, but you must organize

More information

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Programming in C++ Prof. Partha Pratim Das Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture - 31 Static Members Welcome to Module 16 of Programming in C++.

More information

CS61A Discussion Notes: Week 11: The Metacircular Evaluator By Greg Krimer, with slight modifications by Phoebus Chen (using notes from Todd Segal)

CS61A Discussion Notes: Week 11: The Metacircular Evaluator By Greg Krimer, with slight modifications by Phoebus Chen (using notes from Todd Segal) CS61A Discussion Notes: Week 11: The Metacircular Evaluator By Greg Krimer, with slight modifications by Phoebus Chen (using notes from Todd Segal) What is the Metacircular Evaluator? It is the best part

More information

COMP322 - Introduction to C++ Lecture 09 - Inheritance continued

COMP322 - Introduction to C++ Lecture 09 - Inheritance continued COMP322 - Introduction to C++ Lecture 09 - Inheritance continued Dan Pomerantz School of Computer Science 11 March 2012 Recall from last time Inheritance describes the creation of derived classes from

More information

LMS Instructions. To watch a video simply click on a category, then select the title you would like to train on and click play.

LMS Instructions. To watch a video simply click on a category, then select the title you would like to train on and click play. LMS Instructions Welcome to our learning management system! This is a guide and will explain you the basic functions of the LMS. If you are not already logged in you will notice a login option up top in

More information

Principles of Object Oriented Programming. Lecture 4

Principles of Object Oriented Programming. Lecture 4 Principles of Object Oriented Programming Lecture 4 Object-Oriented Programming There are several concepts underlying OOP: Abstract Types (Classes) Encapsulation (or Information Hiding) Polymorphism Inheritance

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

Introduction to Programming

Introduction to Programming Introduction to Programming Summer Term 2014 Dr. Adrian Kacso, Univ. Siegen adriana.dkacsoa@duni-siegena.de Tel.: 0271/740-3966, Office: H-B 8406 State: April 9, 2014 Betriebssysteme / verteilte Systeme

More information

A Short Summary of Javali

A Short Summary of Javali A Short Summary of Javali October 15, 2015 1 Introduction Javali is a simple language based on ideas found in languages like C++ or Java. Its purpose is to serve as the source language for a simple compiler

More information

1 of 5 5/11/2006 12:10 AM CS 61A Spring 2006 Midterm 2 solutions 1. Box and pointer. Note: Please draw actual boxes, as in the book and the lectures, not XX and X/ as in these ASCII-art solutions. Also,

More information

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++ No. of Printed Pages : 3 I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination 05723. June, 2015 BCS-031 : PROGRAMMING IN C ++ Time : 3 hours Maximum Marks : 100 (Weightage 75%)

More information

Math Released Item Grade 5. Leftover Soup VH104537

Math Released Item Grade 5. Leftover Soup VH104537 Math Released Item 2016 Grade 5 Leftover Soup VH104537 Prompt Task is worth a total of 3 points. Rubric Leftover Soup Score Description Student response includes the following 3 elements: Reasoning point

More information

2. You are required to enter a password of up to 100 characters. The characters must be lower ASCII, printing characters.

2. You are required to enter a password of up to 100 characters. The characters must be lower ASCII, printing characters. BLACK BOX SOFTWARE TESTING SPRING 2005 DOMAIN TESTING LAB PROJECT -- GRADING NOTES For all of the cases below, do the traditional equivalence class and boundary analysis. Draw one table and use a new line

More information

CS 1044 Program 6 Summer I dimension ??????

CS 1044 Program 6 Summer I dimension ?????? Managing a simple array: Validating Array Indices Most interesting programs deal with considerable amounts of data, and must store much, or all, of that data on one time. The simplest effective means for

More information

i) Natural numbers: Counting numbers, i.e, 1, 2, 3, 4,. are called natural numbers.

i) Natural numbers: Counting numbers, i.e, 1, 2, 3, 4,. are called natural numbers. Chapter 1 Integers Types of Numbers i) Natural numbers: Counting numbers, i.e, 1, 2, 3, 4,. are called natural numbers. ii) Whole numbers: Counting numbers and 0, i.e., 0, 1, 2, 3, 4, 5,.. are called whole

More information

COMP519 Web Programming Lecture 14: JavaScript (Part 5) Handouts

COMP519 Web Programming Lecture 14: JavaScript (Part 5) Handouts COMP519 Web Programming Lecture 14: JavaScript (Part 5) Handouts Ullrich Hustadt Department of Computer Science School of Electrical Engineering, Electronics, and Computer Science University of Liverpool

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

LABORATORY 1 REVISION

LABORATORY 1 REVISION UTCN Computer Science Department Software Design 2012/2013 LABORATORY 1 REVISION ================================================================== I. UML Revision This section focuses on reviewing the

More information

OHIO ASSESSMENTS FOR EDUCATORS (OAE) FIELD 010: COMPUTER INFORMATION SCIENCE

OHIO ASSESSMENTS FOR EDUCATORS (OAE) FIELD 010: COMPUTER INFORMATION SCIENCE OHIO ASSESSMENTS FOR EDUCATORS (OAE) FIELD 010: COMPUTER INFORMATION SCIENCE June 2013 Content Domain Range of Competencies Approximate Percentage of Assessment Score I. Computer Use in Educational Environments

More information

Programming Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science Indian Institute of Technology, Madras

Programming Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science Indian Institute of Technology, Madras Programming Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science Indian Institute of Technology, Madras Module 12B Lecture - 41 Brief introduction to C++ Hello, welcome

More information

COMP 105 Homework: Type Systems

COMP 105 Homework: Type Systems Due Tuesday, March 29, at 11:59 PM (updated) The purpose of this assignment is to help you learn about type systems. Setup Make a clone of the book code: git clone linux.cs.tufts.edu:/comp/105/build-prove-compare

More information

Lesson 6: Manipulating Equations

Lesson 6: Manipulating Equations Lesson 6: Manipulating Equations Manipulating equations is probably one of the most important skills to master in a high school physics course. Although it is based on familiar (and fairly simple) math

More information

(Refer Slide Time: 00:01:30)

(Refer Slide Time: 00:01:30) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology, Madras Lecture - 32 Design using Programmable Logic Devices (Refer Slide Time: 00:01:30)

More information

LAB 12: ARRAYS (ONE DIMINSION)

LAB 12: ARRAYS (ONE DIMINSION) Statement Purpose: The purpose of this Lab. is to practically familiarize student with the concept of array and related operations performed on array. Activity Outcomes: Student will understand the concept

More information

B.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 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

ENCM 369 Winter 2019 Lab 6 for the Week of February 25

ENCM 369 Winter 2019 Lab 6 for the Week of February 25 page of ENCM 369 Winter 29 Lab 6 for the Week of February 25 Steve Norman Department of Electrical & Computer Engineering University of Calgary February 29 Lab instructions and other documents for ENCM

More information

Chapter 4C Homework Functions III Individual Assignment 30 Points Questions 6 Points Script 24 Points

Chapter 4C Homework Functions III Individual Assignment 30 Points Questions 6 Points Script 24 Points PCS1-Ch-4C-Functions-3-HW.docx CSCI 1320 Initials P a g e 1 If this lab is an Individual assignment, you must do all coded programs on your own. You may ask others for help on the language syntax, but

More information

Please indicate EDM in the subject box

Please indicate EDM in the subject box I. Course Description: This course provides second year medical students with the basic facts and principles of Human Physiology. These principles are necessary to understand the mechanisms of disease,

More information

Solutions for Transformations of Functions

Solutions for Transformations of Functions Solutions for Transformations of Functions I. Souldatos February 20, 209 Answers Problem... Let f(x) = (x + 3) x (x ). Match the following compositions with the functions below. A. f(x + 2) B. f(x 2) C.

More information

CSC D84 Assignment 2 Game Trees and Mini-Max

CSC D84 Assignment 2 Game Trees and Mini-Max 0 The Cats Strike Back Due date: Wednesday, Feb. 21, 9am (electronic submission on Mathlab) This assignment can be completed individually, or by a team of 2 students This assignment is worth 10 units toward

More information

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)

CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators) Name: Email address: Quiz Section: CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will

More information

! Mon, May 5, 2:00PM to 4:30PM. ! Closed book, closed notes, clean desk. ! Comprehensive (covers entire course) ! 30% of your final grade

! Mon, May 5, 2:00PM to 4:30PM. ! Closed book, closed notes, clean desk. ! Comprehensive (covers entire course) ! 30% of your final grade Final Exam Review Final Exam Mon, May 5, 2:00PM to 4:30PM CS 2308 Spring 2014 Jill Seaman Closed book, closed notes, clean desk Comprehensive (covers entire course) 30% of your final grade I recommend

More information

MSO Exam November 7, 2016, 13:30 15:30, Educ-Gamma

MSO Exam November 7, 2016, 13:30 15:30, Educ-Gamma MSO 2016 2017 Exam November 7, 2016, 13:30 15:30, Educ-Gamma Name: Student number: Please read the following instructions carefully: Fill in your name and student number above. Be prepared to identify

More information

Writing Practice Tool Guide

Writing Practice Tool Guide Writing Practice Tool Guide Virginia Standards of Learning Grades 5, 8, & End-of-Course (EOC) Writing February, 2013 Pearson 1 Revised February 14, 2013 Table of Contents OVERVIEW... 3 SYSTEM REQUIREMENTS

More information

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal

COMSC-051 Java Programming Part 1. Part-Time Instructor: Joenil Mistal COMSC-051 Java Programming Part 1 Part-Time Instructor: Joenil Mistal Chapter 4 4 Moving Toward Object- Oriented Programming This chapter provides a provides an overview of basic concepts of the object-oriented

More information

PREMOCK GCE EXAMINATIONS

PREMOCK GCE EXAMINATIONS PROGRESSIVE COMPREHENSIVE HIGH SCHOOL (PCHS) MANKON, BAMENDA PREMOCK GCE EXAMINATIONS OCTOBER 2013 Subject/Code: Computer Science 795 Paper N 1 Examiner DZEUGANG Placide ADVANCED LEVEL 795 COMPUTER SCIENCE

More information

2015 Paper E2.1: Digital Electronics II

2015 Paper E2.1: Digital Electronics II s 2015 Paper E2.1: Digital Electronics II Answer ALL questions. There are THREE questions on the paper. Question ONE counts for 40% of the marks, other questions 30% Time allowed: 2 hours (Not to be removed

More information

CS1210 Lecture 28 Mar. 27, 2019

CS1210 Lecture 28 Mar. 27, 2019 CS1210 Lecture 28 Mar. 27, 2019 Discussion section exam scores posted score # people 0-5 6-10 11-15 16-20 21-25 26-30 28 48 39 37 30 9 median: 13 Some words about overall grades more detail next Wednesday

More information

York University AS/AK/ITEC INTRODUCTION TO DATA STRUCTURES. Midterm Sample I. Examiner: S. Chen Duration: One Hour and 30 Minutes

York University AS/AK/ITEC INTRODUCTION TO DATA STRUCTURES. Midterm Sample I. Examiner: S. Chen Duration: One Hour and 30 Minutes York University AS/AK/ITEC 2620 3.0 INTRODUCTION TO DATA STRUCTURES Midterm Sample I Examiner: S. Chen Duration: One Hour and 30 Minutes This exam is closed textbook(s) and closed notes. Use of any electronic

More information

CS303 LOGIC DESIGN FINAL EXAM

CS303 LOGIC DESIGN FINAL EXAM JANUARY 2017. CS303 LOGIC DESIGN FINAL EXAM STUDENT NAME & ID: DATE: Instructions: Examination time: 100 min. Write your name and student number in the space provided above. This examination is closed

More information

Object-Oriented Programming

Object-Oriented Programming - oriented - iuliana@cs.ubbcluj.ro Babes-Bolyai University 2018 1 / 56 Overview - oriented 1 2 -oriented 3 4 5 6 7 8 Static and friend elements 9 Summary 2 / 56 I - oriented was initially created by Bjarne

More information

JavaScript: Sort of a Big Deal,

JavaScript: Sort of a Big Deal, : Sort of a Big Deal, But Sort of Quirky... March 20, 2017 Lisp in C s Clothing (Crockford, 2001) Dynamically Typed: no static type annotations or type checks. C-Like Syntax: curly-braces, for, semicolons,

More information

Object Oriented Programming

Object Oriented Programming Object Oriented Programming Course Code: CS 212 Semester: 2 nd Credit Hours: 3+1 Prerequisite Codes: CS-110: Fundamentals of Computer Programming Instructor: Shamyl Bin Mansoor Class: BESE-5 AB Office:

More information

OOP- 5 Stacks Individual Assignment 35 Points

OOP- 5 Stacks Individual Assignment 35 Points OOP-5-Stacks-HW.docx CSCI 2320 Initials P a g e 1 If this lab is an Individual assignment, you must do all coded programs on your own. You may ask others for help on the language syntax, but you must organize

More information

PCS1-Ch-3B-Basic-Loops-HW CSCI 1320 Initials P a g e 1

PCS1-Ch-3B-Basic-Loops-HW CSCI 1320 Initials P a g e 1 PCS1-Ch-3B-Basic-Loops-HW CSCI 1320 Initials P a g e 1 If this lab is an Individual assignment, you must do all coded programs on your own. You may ask others for help on the language syntax, but you must

More information

Hardware Description and Verification Lava Exam

Hardware Description and Verification Lava Exam Hardware Description and Verification Lava Exam Mary Sheeran Revised by Thomas Hallgren hallgren@chalmers.se May 16, 2010 Introduction The purpose of this take-home exam is to give you further practice

More information

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented

Subclass Gist Example: Chess Super Keyword Shadowing Overriding Why? L10 - Polymorphism and Abstract Classes The Four Principles of Object Oriented Table of Contents L01 - Introduction L02 - Strings Some Examples Reserved Characters Operations Immutability Equality Wrappers and Primitives Boxing/Unboxing Boxing Unboxing Formatting L03 - Input and

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

Week 5: Background. A few observations on learning new programming languages. What's wrong with this (actual) protest from 1966?

Week 5: Background. A few observations on learning new programming languages. What's wrong with this (actual) protest from 1966? Week 5: Background A few observations on learning new programming languages What's wrong with this (actual) protest from 1966? Programmer: "Switching to PL/I as our organization's standard programming

More information

Common Misunderstandings from Exam 1 Material

Common Misunderstandings from Exam 1 Material Common Misunderstandings from Exam 1 Material Kyle Dewey Stack and Heap Allocation with Pointers char c = c ; char* p1 = malloc(sizeof(char)); char** p2 = &p1; Where is c allocated? Where is p1 itself

More information

Sai Nath University. Assignment For BCA 3 RD Sem.

Sai Nath University. Assignment For BCA 3 RD Sem. 1 Sai Nath University Assignment For BCA 3 RD Sem. The Assignment will consist of two parts, A and B. will have 5 short answer questions(40-60 words) of 4 marks each. will have 4 long answer questions

More information

BM214E Object Oriented Programming Lecture 11

BM214E Object Oriented Programming Lecture 11 BM214E Oriented Programming Lecture 11 Interfaces & Polymorphism (continued) Mini-review References: Pointers to objects. Include many of the classic confusing things about pointers! Inheritance: defined

More information

Relationships Between Real Things. CSE 143 Java. Common Relationship Patterns. Composition: "has a" CSE143 Sp Student.

Relationships Between Real Things. CSE 143 Java. Common Relationship Patterns. Composition: has a CSE143 Sp Student. CSE 143 Java Object & Class Relationships Inheritance Reading: Ch. 9, 14 Relationships Between Real Things Man walks dog Dog strains at leash Dog wears collar Man wears hat Girl feeds dog Girl watches

More information

9/19/2018 Programming Data Structures. Polymorphism And Abstract

9/19/2018 Programming Data Structures. Polymorphism And Abstract 9/19/2018 Programming Data Structures Polymorphism And Abstract 1 In-class assignment: deadline noon!! 2 Overview: 4 main concepts in Object-Oriented Encapsulation in Java is a mechanism of wrapping the

More information

Where The Objects Roam

Where The Objects Roam CS61A, Spring 2006, Wei Tu (Based on Chung s Notes) 1 CS61A Week 8 Where The Objects Roam (v1.0) Paradigm Shift (or: The Rabbit Dug Another Hole) And here we are, already ready to jump into yet another

More information

Human Computer Interaction Lecture 16. User Support

Human Computer Interaction Lecture 16. User Support Human Computer Interaction Lecture 16 User Support User Support Main Types of user support quick reference, task specific help, full explanation, tutorial Issues different types of support at different

More information

Object Oriented Programming. Solved MCQs - Part 2

Object Oriented Programming. Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 Object Oriented Programming Solved MCQs - Part 2 It is possible to declare as a friend A member function A global function A class All of the above What

More information

EC312 Chapter 4: Arrays and Strings

EC312 Chapter 4: Arrays and Strings Objectives: (a) Describe how an array is stored in memory. (b) Define a string, and describe how strings are stored. EC312 Chapter 4: Arrays and Strings (c) Describe the implications of reading or writing

More information

CMSC131. Objects: Designing Classes and Creating Instances

CMSC131. Objects: Designing Classes and Creating Instances CMSC131 Objects: Designing Classes and Creating Instances Classes and Instances of Objects We have seen that each Java application we run has a static main method that serves as the starting point. The

More information

Computer Science Department Carlos III University of Madrid Leganés (Spain) David Griol Barres

Computer Science Department Carlos III University of Madrid Leganés (Spain) David Griol Barres Computer Science Department Carlos III University of Madrid Leganés (Spain) David Griol Barres dgriol@inf.uc3m.es Introduction He am a driver might be syntactically correct but semantically wrong. Semantic

More information

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017

Programming Language Concepts Object-Oriented Programming. Janyl Jumadinova 28 February, 2017 Programming Language Concepts Object-Oriented Programming Janyl Jumadinova 28 February, 2017 Three Properties of Object-Oriented Languages: Encapsulation Inheritance Dynamic method binding (polymorphism)

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

York University. AP/ITEC Section M INTRODUCTION TO DATA STRUCTURES Winter Midterm Test

York University. AP/ITEC Section M INTRODUCTION TO DATA STRUCTURES Winter Midterm Test York University AP/ITEC 2620 3.0 Section M INTRODUCTION TO DATA STRUCTURES Winter 2016 Midterm Test Examiner: S. Chen Duration: One Hour and 30 Minutes This exam is closed textbook(s) and closed notes.

More information

JavaScript: Objects, Methods, Prototypes

JavaScript: Objects, Methods, Prototypes JavaScript: Objects, Methods, Prototypes Computer Science and Engineering College of Engineering The Ohio State University Lecture 22 What is an Object? Property: a key/value pair (aka "name"/value) Object:

More information

Object-role modelling (ORM)

Object-role modelling (ORM) Introduction to modeling WS 2015/16 Object-role modelling (ORM) Slides for this part are based on Chapters 3-7 from Halpin, T. & Morgan, T. 2008, Information Modeling and Relational Databases, Second Edition

More information

Exam 2. CSI 201: Computer Science 1 Fall 2016 Professors: Shaun Ramsey and Kyle Wilson. Question Points Score Total: 80

Exam 2. CSI 201: Computer Science 1 Fall 2016 Professors: Shaun Ramsey and Kyle Wilson. Question Points Score Total: 80 Exam 2 CSI 201: Computer Science 1 Fall 2016 Professors: Shaun Ramsey and Kyle Wilson Question Points Score 1 18 2 29 3 18 4 15 Total: 80 I understand that this exam is closed book and closed note and

More information

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns

Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Software Engineering Prof. Rushikesh K.Joshi IIT Bombay Lecture-15 Design Patterns Today we are going to talk about an important aspect of design that is reusability of design. How much our old design

More information

CSI 32. Lecture Object-Oriented Paradigm. UML (Unified Modeling Language)

CSI 32. Lecture Object-Oriented Paradigm. UML (Unified Modeling Language) Lecture 3 1.4 Object-Oriented Paradigm UML (Unified Modeling Language) The Object-Oriented Paradigm - data and operations are paired - programs are composed of self-sufficient modules (objects) each module

More information

Exam Questions. Object-Oriented Design, IV1350. Maximum exam score is 100, grade limits are as follows. Score Grade 90 A 80 B 70 C 60 D 50 E

Exam Questions. Object-Oriented Design, IV1350. Maximum exam score is 100, grade limits are as follows. Score Grade 90 A 80 B 70 C 60 D 50 E Object-Oriented Design, IV1350 Maximum exam score is 100, grade limits are as follows. Score Grade 90 A 80 B 70 C 60 D 50 E The exam questions will be a subset of the questions below. The exam may contain

More information

LMS Instructions. To watch a video simply click on a category, then select the title you would like to train on and click play.

LMS Instructions. To watch a video simply click on a category, then select the title you would like to train on and click play. LMS Instructions Welcome to our learning management system! This is a guide and will explain you the basic functions of the LMS. If you are not already logged in you will notice a login option up top in

More information

Grade Level: 6-8 Sunshine State Standard: MA.A.1.3.3, MA.A.3.3.1, MA.B.1.3.2, MA.B.4.3.2, MA.C Time: 45 minutes

Grade Level: 6-8 Sunshine State Standard: MA.A.1.3.3, MA.A.3.3.1, MA.B.1.3.2, MA.B.4.3.2, MA.C Time: 45 minutes Rotations Grade Level: 6-8 Sunshine State Standard: MA.A.1.3.3, MA.A.3.3.1, MA.B.1.3.2, MA.B.4.3.2, MA.C.3.3.2 Time: 45 minutes Materials: Students: Paper, pencil, graph paper, computer with GeoGebra (if

More information

Be sure check the official clarification thread for corrections or updates to this document or to the distributed code.

Be sure check the official clarification thread for corrections or updates to this document or to the distributed code. Com S 228 Spring 2011 Programming Assignment 1 Part 1 (75 points): Due at 11:59 pm, Friday, January 28 Part 2 (225 points): Due at 11:59 pm, Monday, February 7 This assignment is to be done on your own.

More information

Activity 7: Arrays. Content Learning Objectives. Process Skill Goals

Activity 7: Arrays. Content Learning Objectives. Process Skill Goals Activity 7: Arrays Programs often need to store multiple values of the same type, such as a list of phone numbers, or the names of your top 20 favorite songs. Rather than create a separate variable for

More information

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++ Introduction to Programming in C++ Course Text Programming in C++, Zyante, Fall 2013 edition. Course book provided along with the course. Course Description This course introduces programming in C++ and

More information

CS164: Final Exam. Fall 2003

CS164: Final Exam. Fall 2003 CS164: Final Exam Fall 2003 Please read all instructions (including these) carefully. Write your name, login, and circle the time of your section. Read each question carefully and think about what s being

More information

Data Structure and Algorithm Homework #3 Due: 2:20pm, Tuesday, April 9, 2013 TA === Homework submission instructions ===

Data Structure and Algorithm Homework #3 Due: 2:20pm, Tuesday, April 9, 2013 TA   === Homework submission instructions === Data Structure and Algorithm Homework #3 Due: 2:20pm, Tuesday, April 9, 2013 TA email: dsa1@csientuedutw === Homework submission instructions === For Problem 1, submit your source code, a Makefile to compile

More information

Lab - 8 Awk Programming

Lab - 8 Awk Programming Lab - 8 Awk Programming AWK is another interpreted programming language which has powerful text processing capabilities. It can solve complex text processing tasks with a few lines of code. Listed below

More information

OO Techniques & UML Class Diagrams

OO Techniques & UML Class Diagrams OO Techniques & UML Class Diagrams SE3A04 Tutorial Jason Jaskolka Department of Computing and Software Faculty of Engineering McMaster University Hamilton, Ontario, Canada jaskolj@mcmaster.ca October 17,

More information

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester

Lab Manual. Object Oriented Analysis And Design. TE(Computer) VI semester Lab Manual Object Oriented Analysis And Design TE(Computer) VI semester Index Sr. No. Title of Programming Assignment Page No. 1 2 3 4 5 6 7 8 9 10 Study of Use Case Diagram Study of Activity Diagram Study

More information

Spring Semester, Dr. Punch. Exam #2 (03/28), form 2 C

Spring Semester, Dr. Punch. Exam #2 (03/28), form 2 C Spring Semester, Dr. Punch. Exam #2 (03/28), form 2 C Last name (printed): First name (printed): Directions: a) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN. b) You have 90 minutes to

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 9: Generalization/Specialization 1 Analysis Workflow: Analyze a Use Case The analysis workflow consists of the following activities: Architectural

More information

FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011

FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011 FACADE & ADAPTER CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 7 09/13/2011 1 Goals of the Lecture Introduce two design patterns Facade Adapter Compare and contrast the two patterns 2 Facade

More information

CS 104 (Spring 2014) Final Exam 05/09/2014

CS 104 (Spring 2014) Final Exam 05/09/2014 CS 104 (Spring 2014) Final Exam 05/09/2014 G o o d L u c k Your Name, USC username, and Student ID: This exam has 8 pages and 8 questions. If yours does not, please contact us immediately. Please read

More information

CS 455 Midterm Exam 1 Fall 2015 [Bono] Thursday, Oct. 1, 2015

CS 455 Midterm Exam 1 Fall 2015 [Bono] Thursday, Oct. 1, 2015 Name: USC netid (e.g., ttrojan): CS 455 Midterm Exam 1 Fall 2015 [Bono] Thursday, Oct. 1, 2015 There are 5 problems on the exam, with 58 points total available. There are 10 pages to the exam (5 pages

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING Classes and Objects So far you have explored the structure of a simple program that starts execution at main() and enables you to declare local and global variables and constants and branch your execution

More information

EXAMINATION INSTRUCTIONS

EXAMINATION INSTRUCTIONS Midterm exam CSE115/503 Computer Science I Spring 2019 EXAMINATION INSTRUCTIONS This examination has 9 pages. If your copy is missing a page, let one of the course staff know. Before starting this test,

More information

GO MOCK TEST GO MOCK TEST I

GO MOCK TEST GO MOCK TEST I http://www.tutorialspoint.com GO MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Go. You can download these sample mock tests at your local machine

More information

JavaScript. Training Offer for JavaScript Introduction JavaScript. JavaScript Objects

JavaScript. Training Offer for JavaScript Introduction JavaScript. JavaScript Objects JavaScript CAC Noida is an ISO 9001:2015 certified training center with professional experience that dates back to 2005. The vision is to provide professional education merging corporate culture globally

More information

Java Concepts: Compatible With Java 5, 6 And 7 By Cay S. Horstmann

Java Concepts: Compatible With Java 5, 6 And 7 By Cay S. Horstmann Java Concepts: Compatible With Java 5, 6 And 7 By Cay S. Horstmann Java Concepts: Compatible with Java 5, 6 and 7 by Horstmann, Cay S. and a great selection of similar Used, New and Collectible Books available

More information