Ryerson University Department of Electrical & Computer Engineering COE618 Midterm Examination February 26, 2013

Size: px
Start display at page:

Download "Ryerson University Department of Electrical & Computer Engineering COE618 Midterm Examination February 26, 2013"

Transcription

1 Ryerson University Department of Electrical & Computer Engineering COE618 Midterm Examination February 26, 2013 Name: Student # : Time: 90 minutes Instructions This exam contains 6 questions. Please check your copy to make sure that it contains 8 pages (including this page) before you start. (1) This is a closed-book exam. (2) If in doubt on any question, then you must clearly state your own assumption(s). (3) Answer all of the following questions in the space provided. For marking use only (do not fill) Questions Score Max Total 70 1

2 1. (10 marks) Write TRUE or FALSE beside each of the following statements: a) A producer creates new objects of a data abstraction given objects of their type as input. b) An abstraction function must be one-to-one. c) An immutable class must declare all its instance variables to be final. d) An abstraction function captures the designer s intent in choosing a particular representation. d) A change to the concrete representation of a data abstraction always changes the abstract concept that is represented. 2. (10 marks) a) Name two relationships that can exist between two use cases. b) Which UML diagram describes the dynamic behavior of the system? c) Which UML diagram describes the static structure of the system? 2

3 d) Which UML diagram describes the functionality of the system from the user s point of view. 3. (10 marks) Consider the following code: public class Recursion { public static void main(string[] args) { recurse("world"); public static void recurse(string w) { int l = w.length(); if(l == 1) { System.out.println(w); return; System.out.println(w); String v = w.substring(0, l-1); recurse(v); System.out.println(w); What will be the output if we run the main method of the Recursion class. [Note: The substring(int beginindex, int endindex) method of the String class returns a new string that is a substring of this string. The substring begins at the specified beginindex and extends to the character at index endindex - 1. Thus the length of the substring is endindexbeginindex.] 3

4 4. (10 marks) Consider the following Java code. The classes E is not a checked exception. 1 public class Main { 2 public static void main(string[] args) { 3 int[] a = {2, 4, 3; 4 try { if( i == 3 ) throw new E(); 8 int j = a[i]; 9 System.out.println( i + j ); catch(e e) { 12 System.out.println("catch of E"); catch(arrayindexoutofboundsexception e) { 15 System.out.println("catch of ArrayIndexOutOfBoundsException"); finally { 18 System.out.println("inside finally"); System.out.println("main ends");

5 Indicate the output of this code for the following cases: (a) In Line 5, the statement is int i = 2; (b) In Line 5, the statement is int i = 3; c) In Line 5, the statement is int i = 4; 5

6 5. (20 marks) Consider the following implementation of the Account class: public class Account implements Cloneable { //OVERVIEW: Account represents a bank account. A typical bank //account has owner s name and balance. // Abstraction function is: // AF(c) = an account A // where A.name = c.name and // A.balance = sum (for all i) of c.transactions[i]; // Rep invariant is // c.name!= null and // sum (for all i) of c.transactions[i] >= 0 private String name; private int[] transactions; public Account(String n, int[] trans) { this.name = n; this.transactions = trans; repok(); public boolean repok() { // EFFECTS: Returns true if the rep invariant holds // for this; otherwise returns false // a) Write your code here 6

7 public Account clone() throws CloneNotSupportedException { // b) Write your code here a) Fill in the body of the repok() method. b) Override the clone() method so that it returns a deep copy (and not a shallow copy). c) Does Account class expose its rep? Explain. 7

8 6. (10 marks) Consider the following class definition: public class Item { private int id; private Item next; public Item(int i, Item n) { id = i; next = n; public void setnext(item n) { next = n; public Item getnext() { return next; Write code segments that results in the reference diagram shown below: (squares are Item objects with its two instance variables; a, b and c are Item references) a 5 b 9 c 2 1 8

CS 455 Midterm Exam 2 Fall 2016 [Bono] November 8, 2016

CS 455 Midterm Exam 2 Fall 2016 [Bono] November 8, 2016 Name: USC NetID (e.g., ttrojan): CS 455 Midterm Exam 2 Fall 2016 [Bono] November 8, 2016 There are 7 problems on the exam, with 50 points total available. There are 8 pages to the exam (4 pages double-sided),

More information

Data abstractions: ADTs Invariants, Abstraction function. Lecture 4: OOP, autumn 2003

Data abstractions: ADTs Invariants, Abstraction function. Lecture 4: OOP, autumn 2003 Data abstractions: ADTs Invariants, Abstraction function Lecture 4: OOP, autumn 2003 Limits of procedural abstractions Isolate implementation from specification Dependency on the types of parameters representation

More information

Prelim One Solution. CS211 Fall Name. NetID

Prelim One Solution. CS211 Fall Name. NetID Name NetID Prelim One Solution CS211 Fall 2005 Closed book; closed notes; no calculators. Write your name and netid above. Write your name clearly on each page of this exam. For partial credit, you must

More information

Practice exam for CMSC131-04, Fall 2017

Practice exam for CMSC131-04, Fall 2017 Practice exam for CMSC131-04, Fall 2017 Q1 makepalindrome - Relevant topics: arrays, loops Write a method makepalidrome that takes an int array, return a new int array that contains the values from the

More information

COE318 Lecture Notes Week 10 (Nov 7, 2011)

COE318 Lecture Notes Week 10 (Nov 7, 2011) COE318 Software Systems Lecture Notes: Week 10 1 of 5 COE318 Lecture Notes Week 10 (Nov 7, 2011) Topics More about exceptions References Head First Java: Chapter 11 (Risky Behavior) The Java Tutorial:

More information

CS 112 Programming 2. Lecture 10. Abstract Classes & Interfaces (1) Chapter 13 Abstract Classes and Interfaces

CS 112 Programming 2. Lecture 10. Abstract Classes & Interfaces (1) Chapter 13 Abstract Classes and Interfaces CS 112 Programming 2 Lecture 10 Abstract Classes & Interfaces (1) Chapter 13 Abstract Classes and Interfaces 2 1 Motivations We have learned how to write simple programs to create and display GUI components.

More information

PASS4TEST IT 인증시험덤프전문사이트

PASS4TEST IT 인증시험덤프전문사이트 PASS4TEST IT 인증시험덤프전문사이트 http://www.pass4test.net 일년동안무료업데이트 Exam : 1z0-809 Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z0-809 Exam's Question and Answers 1 from

More information

Abstract Classes and Interfaces

Abstract Classes and Interfaces Abstract Classes and Interfaces Reading: Reges and Stepp: 9.5 9.6 CSC216: Programming Concepts Sarah Heckman 1 Abstract Classes A Java class that cannot be instantiated, but instead serves as a superclass

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor: Alan

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

CS 2334: Programming Structures and Abstractions: Exam 1 October 3, 2016

CS 2334: Programming Structures and Abstractions: Exam 1 October 3, 2016 General instructions: CS 2334: Programming Structures and Abstractions: Exam 1 October 3, 2016 Please wait to open this exam booklet until you are told to do so. This examination booklet has 13 pages.

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2006 FINAL EXAMINATION 7pm to 10pm, 19 DECEMBER 2006, Jeffrey Hall 1 st Floor Instructor:

More information

Tecniche di Progettazione: Design Patterns

Tecniche di Progettazione: Design Patterns Tecniche di Progettazione: Design Patterns GoF: Prototype 1 Design patterns, Laura Semini, Università di Pisa, Dipartimento di Informatica. Prototype Pattern A creational pattern Specify the kinds of objects

More information

Practice Midterm 1. Problem Points Score TOTAL 50

Practice Midterm 1. Problem Points Score TOTAL 50 CS 120 Software Design I Spring 2019 Practice Midterm 1 University of Wisconsin - La Crosse February 25 NAME: Do not turn the page until instructed to do so. This booklet contains 10 pages including the

More information

Birkbeck (University of London) Software and Programming 1 In-class Test Mar 2018

Birkbeck (University of London) Software and Programming 1 In-class Test Mar 2018 Birkbeck (University of London) Software and Programming 1 In-class Test 2.1 22 Mar 2018 Student Name Student Number Answer ALL Questions 1. What output is produced when the following Java program fragment

More information

Introduction to Computer Science II (CSI 1101)

Introduction to Computer Science II (CSI 1101) Introduction to Computer Science II (CSI 1101) Professor: M. Turcotte February 2002, duration: 75 minutes Identification Student name: last name: Section: Student number: initials: Signature: Instructions

More information

CIS 1068 Design and Abstraction Spring 2017 Midterm 1a

CIS 1068 Design and Abstraction Spring 2017 Midterm 1a Spring 2017 Name: TUID: Page Points Score 1 28 2 18 3 12 4 12 5 15 6 15 Total: 100 Instructions The exam is closed book, closed notes. You may not use a calculator, cell phone, etc. i Some API Reminders

More information

public Candy() { ingredients = new ArrayList<String>(); ingredients.add("sugar");

public Candy() { ingredients = new ArrayList<String>(); ingredients.add(sugar); Cloning Just like the name implies, cloning is making a copy of something. To be true to the nature of cloning, it should be an exact copy. While this can be very useful, it is not always necessary. For

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

Object Oriented Programming. What is this Object? Using the Object s Slots

Object Oriented Programming. What is this Object? Using the Object s Slots 1 Object Oriented Programming Chapter 2 introduces Object Oriented Programming. OOP is a relatively new approach to programming which supports the creation of new data types and operations to manipulate

More information

CSC 1051 Algorithms and Data Structures I. Midterm Examination March 1, Name: KEY A

CSC 1051 Algorithms and Data Structures I. Midterm Examination March 1, Name: KEY A CSC 1051 Algorithms and Data Structures I Midterm Examination March 1, 2018 Name: KEY A Question Value Score 1 20 2 20 3 20 4 20 5 20 TOTAL 100 Please answer questions in the spaces provided. If you make

More information

Arrays. Eng. Mohammed Abdualal

Arrays. Eng. Mohammed Abdualal Islamic University of Gaza Faculty of Engineering Computer Engineering Department Computer Programming Lab (ECOM 2114) Created by Eng: Mohammed Alokshiya Modified by Eng: Mohammed Abdualal Lab 9 Arrays

More information

Midterm Exam CS 251, Intermediate Programming October 8, 2014

Midterm Exam CS 251, Intermediate Programming October 8, 2014 Midterm Exam CS 251, Intermediate Programming October 8, 2014 Name: NetID: Answer all questions in the space provided. Write clearly and legibly, you will not get credit for illegible or incomprehensible

More information

Name:... ID:... class A { public A() { System.out.println( "The default constructor of A is invoked"); } }

Name:... ID:... class A { public A() { System.out.println( The default constructor of A is invoked); } } KSU/CCIS/CS CSC 113 Final exam - Fall 12-13 Time allowed: 3:00 Name:... ID:... EXECRICE 1 (15 marks) 1.1 Write the output of the following program. Output (6 Marks): class A public A() System.out.println(

More information

C22a: Problem Solving using Recursion

C22a: Problem Solving using Recursion CISC 3115 TY3 C22a: Problem Solving using Recursion Hui Chen Department of Computer & Information Science CUNY Brooklyn College 11/6/2018 CUNY Brooklyn College 1 Outline Characteristics of recursion Recursion

More information

CS 113 PRACTICE FINAL

CS 113 PRACTICE FINAL CS 113 PRACTICE FINAL There are 13 questions on this test. The value of each question is: 1-10 multiple choice (4 pt) 11-13 coding problems (20 pt) You may get partial credit for questions 11-13. If you

More information

CS 307 Midterm 2 Fall 2010

CS 307 Midterm 2 Fall 2010 Points off 1 2 3 4 Total off Net Score Exam Number: CS 307 Midterm 2 Fall 2010 Name UTEID login name TA's Name: Harsh Yi-Chao (Circle One) Instructions: 1. Please turn off your cell phones and other electronic

More information

CS-140 Fall Binghamton University. Methods. Sect. 3.3, 8.2. There s a method in my madness.

CS-140 Fall Binghamton University. Methods. Sect. 3.3, 8.2. There s a method in my madness. Methods There s a method in my madness. Sect. 3.3, 8.2 1 Example Class: Car How Cars are Described Make Model Year Color Owner Location Mileage Actions that can be applied to cars Create a new car Transfer

More information

CMPSCI 187 Midterm 1 (Feb 17, 2016)

CMPSCI 187 Midterm 1 (Feb 17, 2016) CMPSCI 187 Midterm 1 (Feb 17, 2016) Instructions: This is a closed book, closed notes exam. You have 120 minutes to complete the exam. The exam has 10 pages printed on double sides. Be sure to check both

More information

CIS 110 Introduction To Computer Programming. February 29, 2012 Midterm

CIS 110 Introduction To Computer Programming. February 29, 2012 Midterm CIS 110 Introduction To Computer Programming February 29, 2012 Midterm Name: Recitation # (e.g. 201): Pennkey (e.g. bjbrown): My signature below certifies that I have complied with the University of Pennsylvania

More information

Object Oriented Programming 2012/13. Final Exam June 12th, 2013

Object Oriented Programming 2012/13. Final Exam June 12th, 2013 Object Oriented Programming 2012/13 Final Exam June 12th, 2013 Directions (read carefully): CLEARLY print your name and ID on every page. The exam contains 8 pages divided into 4 parts. Make sure you have

More information

CS-140 Fall Binghamton University. Methods. Sect. 3.3, 8.2. There s a method in my madness.

CS-140 Fall Binghamton University. Methods. Sect. 3.3, 8.2. There s a method in my madness. Methods There s a method in my madness. Sect. 3.3, 8.2 1 Example Class: Car How Cars are Described Make Model Year Color Owner Location Mileage Actions that can be applied to cars Create a new car Transfer

More information

CS 113 MIDTERM EXAM 2 SPRING 2013

CS 113 MIDTERM EXAM 2 SPRING 2013 CS 113 MIDTERM EXAM 2 SPRING 2013 There are 18 questions on this test. The value of each question is: 1-15 multiple choice (3 pts) 17 coding problem (15 pts) 16, 18 coding problems (20 pts) You may get

More information

The Object Class. java.lang.object. Important Methods In Object. Mark Allen Weiss Copyright 2000

The Object Class. java.lang.object. Important Methods In Object. Mark Allen Weiss Copyright 2000 The Object Class Mark Allen Weiss Copyright 2000 1/4/02 1 java.lang.object All classes either extend Object directly or indirectly. Makes it easier to write generic algorithms and data structures Makes

More information

Midterm Exam CS 251, Intermediate Programming March 12, 2014

Midterm Exam CS 251, Intermediate Programming March 12, 2014 Midterm Exam CS 251, Intermediate Programming March 12, 2014 Name: NetID: Answer all questions in the space provided. Write clearly and legibly, you will not get credit for illegible or incomprehensible

More information

University of Palestine. Mid Exam Total Grade: 100

University of Palestine. Mid Exam Total Grade: 100 First Question No. of Branches (5) A) Choose the correct answer: 1. If we type: system.out.println( a ); in the main() method, what will be the result? int a=12; //in the global space... void f() { int

More information

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question)

CS/B.TECH/CSE(New)/SEM-5/CS-504D/ OBJECT ORIENTED PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 GROUP A. (Multiple Choice Type Question) CS/B.TECH/CSE(New)/SEM-5/CS-504D/2013-14 2013 OBJECT ORIENTED PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give their answers

More information

CS 307 Midterm 2 Fall 2009

CS 307 Midterm 2 Fall 2009 Points off 1 2 3 4 5 Total off Net Score Exam Number: CS 307 Midterm 2 Fall 2009 Name UTEID login name TA's Name: Oswaldo Rashid Swati (Circle One) Instructions: 1. Please turn off your cell phones and

More information

CSC 1051 Algorithms and Data Structures I. Midterm Examination October 11, Name: KEY

CSC 1051 Algorithms and Data Structures I. Midterm Examination October 11, Name: KEY CSC 1051 Algorithms and Data Structures I Midterm Examination October 11, 2018 Name: KEY Question Value Score 1 20 2 20 3 20 4 20 5 20 TOTAL 100 Please answer questions in the spaces provided. If you make

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

CIS 110 Introduction to Computer Programming. 7 May 2012 Final Exam

CIS 110 Introduction to Computer Programming. 7 May 2012 Final Exam CIS 110 Introduction to Computer Programming 7 May 2012 Final Exam Name: Recitation # (e.g. 201): Pennkey (e.g. bjbrown): My signature below certifies that I have complied with the University of Pennsylvania

More information

CIS 1068 Program Design and Abstraction Spring2016 Midterm Exam 1. Name SOLUTION

CIS 1068 Program Design and Abstraction Spring2016 Midterm Exam 1. Name SOLUTION CIS 1068 Program Design and Abstraction Spring2016 Midterm Exam 1 Name SOLUTION Page Points Score 2 15 3 8 4 18 5 10 6 7 7 7 8 14 9 11 10 10 Total 100 1 P age 1. Program Traces (41 points, 50 minutes)

More information

Computer Science 145 Midterm 1 Fall 2016

Computer Science 145 Midterm 1 Fall 2016 Computer Science 145 Midterm 1 Fall 2016 Doodle here. This is a closed-book, no-calculator, no-electronic-devices, individual-effort exam. You may reference one page of handwritten notes. All answers should

More information

Object Oriented Programming 2015/16. Final Exam June 28, 2016

Object Oriented Programming 2015/16. Final Exam June 28, 2016 Object Oriented Programming 2015/16 Final Exam June 28, 2016 Directions (read carefully): CLEARLY print your name and ID on every page. The exam contains 8 pages divided into 4 parts. Make sure you have

More information

Selected Questions from by Nageshwara Rao

Selected Questions from  by Nageshwara Rao Selected Questions from http://way2java.com by Nageshwara Rao Swaminathan J Amrita University swaminathanj@am.amrita.edu November 24, 2016 Swaminathan J (Amrita University) way2java.com (Nageshwara Rao)

More information

CIS 120 Midterm II November 8, Name (printed): Pennkey (login id):

CIS 120 Midterm II November 8, Name (printed): Pennkey (login id): CIS 120 Midterm II November 8, 2013 Name (printed): Pennkey (login id): My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity in completing

More information

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch

Binghamton University. CS-140 Fall Problem Solving. Creating a class from scratch Problem Solving Creating a class from scratch 1 Recipe for Writing a Class 1. Write the class boilerplate stuff 2. Declare Fields 3. Write Creator(s) 4. Write accessor methods 5. Write mutator methods

More information

CSIS 10A Practice Final Exam Name:

CSIS 10A Practice Final Exam Name: CSIS 10A Practice Final Exam Name: Multiple Choice: Each question is worth 2 points. Circle the letter of the best answer for the following questions. 1. For the following declarations: int area; String

More information

Faculty of Science COMP-202A - Introduction to Computing I (Fall 2008) Final Examination

Faculty of Science COMP-202A - Introduction to Computing I (Fall 2008) Final Examination First Name: Last Name: McGill ID: Section: Faculty of Science COMP-202A - Introduction to Computing I (Fall 2008) Final Examination Thursday, December 11, 2008 Examiners: Mathieu Petitpas [Section 1] 14:00

More information

Exceptions Questions https://www.journaldev.com/2167/java-exception-interview-questionsand-answers https://www.baeldung.com/java-exceptions-interview-questions https://javaconceptoftheday.com/java-exception-handling-interviewquestions-and-answers/

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

Prelim 1 Solutions. CS 2110, March 10, 2015, 5:30 PM Total Question True False. Loop Invariants Max Score Grader

Prelim 1 Solutions. CS 2110, March 10, 2015, 5:30 PM Total Question True False. Loop Invariants Max Score Grader Prelim 1 Solutions CS 2110, March 10, 2015, 5:30 PM 1 2 3 4 5 Total Question True False Short Answer Recursion Object Oriented Loop Invariants Max 20 15 20 25 20 100 Score Grader The exam is closed book

More information

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below.

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below. C212 Early Evaluation Exam Mon Feb 10 2014 Name: Please provide brief (common sense) justifications with your answers below. 1. What is the type (and value) of this expression: 5 * (7 + 4 / 2) 2. What

More information

Appendix 3. Description: Syntax: Parameters: Return Value: Example: Java - String charat() Method

Appendix 3. Description: Syntax: Parameters: Return Value: Example: Java - String charat() Method Appendix 3 Java - String charat() Method This method returns the character located at the String's specified index. The string indexes start from zero. public char charat(int index) index -- Index of the

More information

Inheritance & Abstract Classes Fall 2018 Margaret Reid-Miller

Inheritance & Abstract Classes Fall 2018 Margaret Reid-Miller Inheritance & Abstract Classes 15-121 Margaret Reid-Miller Today Today: Finish circular queues Exercise: Reverse queue values Inheritance Abstract Classes Clone 15-121 (Reid-Miller) 2 Object Oriented Programming

More information

CSC 1051 Algorithms and Data Structures I. Midterm Examination March 2, Name:

CSC 1051 Algorithms and Data Structures I. Midterm Examination March 2, Name: CSC 1051 Algorithms and Data Structures I Midterm Examination March 2, 2017 Name: Question Value Score 1 10 2 10 3 20 4 20 5 20 6 20 TOTAL 100 Please answer questions in the spaces provided. If you make

More information

Please note that if you write the mid term in pencil, you will not be allowed to submit a remark request.

Please note that if you write the mid term in pencil, you will not be allowed to submit a remark request. University of Toronto CSC148 Introduction to Computer Science Fall 2001 Mid Term Test Section L5101 Duration: 50 minutes Aids allowed: none Make sure that your examination booklet has 8 pages (including

More information

Midterm Exam CS 251, Intermediate Programming March 6, 2015

Midterm Exam CS 251, Intermediate Programming March 6, 2015 Midterm Exam CS 251, Intermediate Programming March 6, 2015 Name: NetID: Answer all questions in the space provided. Write clearly and legibly, you will not get credit for illegible or incomprehensible

More information

CS 110 Practice Final Exam originally from Winter, Instructions: closed books, closed notes, open minds, 3 hour time limit.

CS 110 Practice Final Exam originally from Winter, Instructions: closed books, closed notes, open minds, 3 hour time limit. Name CS 110 Practice Final Exam originally from Winter, 2003 Instructions: closed books, closed notes, open minds, 3 hour time limit. There are 4 sections for a total of 49 points. Part I: Basic Concepts,

More information

CSE 331 Midterm Exam 2/13/12

CSE 331 Midterm Exam 2/13/12 Name There are 10 questions worth a total of 100 points. Please budget your time so you get to all of the questions. Keep your answers brief and to the point. The exam is closed book, closed notes, closed

More information

CS 455 Midterm Exam 2 Spring 2017 [Bono] Tuesday, April 4, 2017

CS 455 Midterm Exam 2 Spring 2017 [Bono] Tuesday, April 4, 2017 Name: USC NetID (e.g., ttrojan): CS 455 Midterm Exam 2 Spring 2017 [Bono] Tuesday, April 4, 2017 There are 7 problems on the exam, with 64 points total available. There are 10 pages to the exam (5 pages

More information

Object Oriented Programming 2015/16. Final Exam June 17, 2016

Object Oriented Programming 2015/16. Final Exam June 17, 2016 Object Oriented Programming 2015/16 Final Exam June 17, 2016 Directions (read carefully): CLEARLY print your name and ID on every page. The exam contains 8 pages divided into 4 parts. Make sure you have

More information

Prototype. Design Pattern. from: Design Patterns (Gamma, Helm, Johnson, and Vlissides) p Justin Hendrix CSPP Winter 2010

Prototype. Design Pattern. from: Design Patterns (Gamma, Helm, Johnson, and Vlissides) p Justin Hendrix CSPP Winter 2010 Prototype Design Pattern Justin Hendrix CSPP 51023 Winter 2010 from: Design Patterns (Gamma, Helm, Johnson, and Vlissides) p. 117-126 Prototype: Intent Specify the kinds of objects to create using a prototypical

More information

Final Exam. COMP Summer I June 26, points

Final Exam. COMP Summer I June 26, points Final Exam COMP 14-090 Summer I 2000 June 26, 2000 200 points 1. Closed book and closed notes. No outside material allowed. 2. Write all answers on the test itself. Do not write any answers in a blue book

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Question Paper CISC124, WINTER TERM, 2012 FINAL EXAMINATION 9am to 12pm, 26 APRIL 2012 Instructor: Alan McLeod If the instructor is

More information

CSCI 135 Exam #2 Fundamentals of Computer Science I Fall 2013

CSCI 135 Exam #2 Fundamentals of Computer Science I Fall 2013 CSCI 135 Exam #2 Fundamentals of Computer Science I Fall 2013 Name: This exam consists of 6 problems on the following 6 pages. You may use your two-sided hand-written 8 ½ x 11 note sheet during the exam.

More information

엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED

엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED 엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University COPYRIGHTS 2017 EOM, HYEONSANG ALL RIGHTS RESERVED Outline - Interfaces - An Instrument interface - Multiple Inheritance

More information

TOPICS TO COVER:-- Array declaration and use.

TOPICS TO COVER:-- Array declaration and use. ARRAYS in JAVA TOPICS TO COVER:-- Array declaration and use. One-Dimensional Arrays. Passing arrays and array elements as parameters Arrays of objects Searching an array Sorting elements in an array ARRAYS

More information

The Irving K. Barber School of Arts and Sciences COSC 111 Final Exam Winter Term II Instructor: Dr. Bowen Hui. Tuesday, April 19, 2016

The Irving K. Barber School of Arts and Sciences COSC 111 Final Exam Winter Term II Instructor: Dr. Bowen Hui. Tuesday, April 19, 2016 First Name (Print): Last Name (Print): Student Number: The Irving K. Barber School of Arts and Sciences COSC 111 Final Exam Winter Term II 2016 Instructor: Dr. Bowen Hui Tuesday, April 19, 2016 Time: 6:00pm

More information

CMSC 331 Second Midterm Exam

CMSC 331 Second Midterm Exam 1 20/ 2 80/ 331 First Midterm Exam 11 November 2003 3 20/ 4 40/ 5 10/ CMSC 331 Second Midterm Exam 6 15/ 7 15/ Name: Student ID#: 200/ You will have seventy-five (75) minutes to complete this closed book

More information

BSc. (Hons.) Software Engineering. Examinations for / Semester 2

BSc. (Hons.) Software Engineering. Examinations for / Semester 2 BSc. (Hons.) Software Engineering Cohort: BSE/04/PT Examinations for 2005-2006 / Semester 2 MODULE: OBJECT ORIENTED PROGRAMMING MODULE CODE: BISE050 Duration: 2 Hours Reading Time: 5 Minutes Instructions

More information

Introduction to Programming Written Examination

Introduction to Programming Written Examination Introduction to Programming Written Examination 23.9.2016 FIRST NAME STUDENT NUMBER LAST NAME SIGNATURE Instructions for students: Write First Name, Last Name, Student Number and Signature where indicated.

More information

Objects and Serialization

Objects and Serialization CS193j, Stanford Handout #18 Summer, 2003 Manu Kumar Objects and Serialization Equals boolean equals(object other) vs == For objects, a == b tests if a and b are the same pointer "shallow" semantics boolean

More information

J.43 The length field of an array object makes the length of the array available. J.44 ARRAYS

J.43 The length field of an array object makes the length of the array available. J.44 ARRAYS ARRAYS A Java array is an Object that holds an ordered collection of elements. Components of an array can be primitive types or may reference objects, including other arrays. Arrays can be declared, allocated,

More information

I. True/False: (2 points each)

I. True/False: (2 points each) CS 102 - Introduction to Programming Midterm Exam #2 - Prof. Reed Fall 2009 What is your name?: There are three sections: I. True/False..............50 points; (25 questions, 2 points each) II. Multiple

More information

Solutions to the 2005 exam

Solutions to the 2005 exam Solutions to the 2005 exam Question 1A [4] In this question, use only the following (algorithm format) Boolean expressions: comparison operators: , =,,, and Boolean logical operators: NOT, AND, OR

More information

Software Construction

Software Construction Lecture 7: Type Hierarchy, Iteration Abstraction Software Construction in Java for HSE Moscow Tom Verhoeff Eindhoven University of Technology Department of Mathematics & Computer Science Software Engineering

More information

Prelim 1. CS 2110, March 15, 2016, 5:30 PM Total Question Name True False. Short Answer

Prelim 1. CS 2110, March 15, 2016, 5:30 PM Total Question Name True False. Short Answer Prelim 1 CS 2110, March 15, 2016, 5:30 PM 0 1 2 3 4 5 Total Question Name True False Short Answer Object- Oriented Recursion Loop Invariants Max 1 20 14 25 19 21 100 Score Grader The exam is closed book

More information

Account joeacct = new Account (100, new Account (500)); Account joeacct = new Account (100, new Account (500, null));

Account joeacct = new Account (100, new Account (500)); Account joeacct = new Account (100, new Account (500, null)); Exam information 369 students took the exam. Scores ranged from 1 to 20, with a median of 11 and an average of 11.1. There were 40 scores between 15.5 and 20, 180 between 10.5 and 15, 132 between 5.5 and

More information

CSI 1100 / 1500 Fall 2004 Introduction to Computer Science I Final Examination

CSI 1100 / 1500 Fall 2004 Introduction to Computer Science I Final Examination CSI 1100 / 1500 Final Examination Page 1 of 13 CSI 1100 / 1500 Fall 2004 Introduction to Computer Science I Final Examination Duration : 3 hours 09:30 December 9, 2004 Professors: Alan Williams, Daniel

More information

Summer Session 2004 Prelim I July 12, CUID: NetID:

Summer Session 2004 Prelim I July 12, CUID: NetID: COM S / ENGRD 211 Computers and Programming Summer Session 2004 Prelim I July 12, 2004 Name: CUID: NetID: You have one hour and fifteen minutes to do this exam. All programs must be written in Java. Where

More information

I pledge by honor that I will not discuss this exam with anyone until my instructor reviews the exam in the class.

I pledge by honor that I will not discuss this exam with anyone until my instructor reviews the exam in the class. Name: Covers Chapters 1-3 50 mins CSCI 1301 Introduction to Programming Armstrong Atlantic State University Instructor: Dr. Y. Daniel Liang I pledge by honor that I will not discuss this exam with anyone

More information

The Object clone() Method

The Object clone() Method The Object clone() Method Introduction In this article from my free Java 8 course, I will be discussing the Java Object clone() method. The clone() method is defined in class Object which is the superclass

More information

CS 116 Week 8 Page 1

CS 116 Week 8 Page 1 CS 116 Week 8: Outline Reading: 1. Dale, Chapter 11 2. Dale, Lab 11 Objectives: 1. Mid-term exam CS 116 Week 8 Page 1 CS 116 Week 8: Lecture Outline 1. Mid-term Exam CS 116 Week 8 Page 2 CS 116 Week 8:

More information

CS170 Introduction to Computer Science Midterm 2

CS170 Introduction to Computer Science Midterm 2 CS170 Introduction to Computer Science Midterm 2 03/25/2009 Name: Solution You are to honor the Emory Honor Code. This is a closed book and closednotes exam, and you are not to use any other resource than

More information

1.00 Introduction to Computers and Engineering Problem Solving. Final Examination - May 19, 2004

1.00 Introduction to Computers and Engineering Problem Solving. Final Examination - May 19, 2004 1.00 Introduction to Computers and Engineering Problem Solving Final Examination - May 19, 2004 Name: E-mail Address: TA: Section: You have 3 hours to complete this exam. For coding questions, you do not

More information

CS 101 Spring 2007 Midterm 2 Name: ID:

CS 101 Spring 2007 Midterm 2 Name:  ID: You only need to write your name and e-mail ID on the first page. This exam is CLOSED text book, closed-notes, closed-calculator, closed-neighbor, etc. Questions are worth different amounts, so be sure

More information

Chapter 13 Abstract Classes and Interfaces

Chapter 13 Abstract Classes and Interfaces Chapter 13 Abstract Classes and Interfaces 1 Abstract Classes Abstraction is to extract common behaviors/properties into a higher level in the class hierarch so that they are shared (implemented) by subclasses

More information

CPSC 211 Introduction to Software Development

CPSC 211 Introduction to Software Development CPSC 211 duction to Software Development Winter 2009-2010 Term 2 Instructor Name: Norm Hutchinson Office: CS/ICICS 319 Email: norm@cs.ubc.ca Office Hours: see web page (or by appointment) Research interests:

More information

Midterm I - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total.

Midterm I - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total. Midterm I - CSE11 Fall 2013 CLOSED BOOK, CLOSED NOTES 50 minutes, 100 points Total. Name: ID: Problem 1) (8 points) For the following code segment, what are the values of i, j, k, and d, after the segment

More information

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. QUEEN'S UNIVERSITY SCHOOL OF COMPUTING HAND IN Answers Are Recorded on Exam Paper CMPE212, WINTER TERM, 2016 FINAL EXAMINATION 9am to 12pm, 19 APRIL 2016 Instructor: Alan McLeod If the instructor is unavailable

More information

This exam is open book. Each question is worth 3 points.

This exam is open book. Each question is worth 3 points. This exam is open book. Each question is worth 3 points. Page 1 / 15 Page 2 / 15 Page 3 / 12 Page 4 / 18 Page 5 / 15 Page 6 / 9 Page 7 / 12 Page 8 / 6 Total / 100 (maximum is 102) 1. Are you in CS101 or

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

CSC 1051 Algorithms and Data Structures I. Midterm Examination October 6, Name:

CSC 1051 Algorithms and Data Structures I. Midterm Examination October 6, Name: CSC 1051 Algorithms and Data Structures I Midterm Examination October 6, 2016 Name: Question Value Score 1 20 2 20 3 20 4 20 5 20 TOTAL 100 Please answer questions in the spaces provided. If you make a

More information

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written.

Page 1 of 16. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Page 1 of 16 HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2005 FINAL EXAMINATION 9am to 12noon, 19 DECEMBER 2005 Instructor: Alan McLeod If

More information

Abstract Classes. Abstract Classes a and Interfaces. Class Shape Hierarchy. Problem AND Requirements. Abstract Classes.

Abstract Classes. Abstract Classes a and Interfaces. Class Shape Hierarchy. Problem AND Requirements. Abstract Classes. a and Interfaces Class Shape Hierarchy Consider the following class hierarchy Shape Circle Square Problem AND Requirements Suppose that in order to exploit polymorphism, we specify that 2-D objects must

More information

Arrays. Weather Problem Array Declaration Accessing Elements Arrays and for Loops Array length field Quick Array Initialization Array Traversals

Arrays. Weather Problem Array Declaration Accessing Elements Arrays and for Loops Array length field Quick Array Initialization Array Traversals Arrays Weather Problem Array Declaration Accessing Elements Arrays and for Loops Array length field Quick Array Initialization Array Traversals Can we solve this problem? Consider the following program

More information

(A) 99 ** (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution

(A) 99 ** (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution Ch 5 Arrays Multiple Choice Test 01. An array is a ** (A) data structure with one, or more, elements of the same type. (B) data structure with LIFO access. (C) data structure, which allows transfer between

More information

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable?

Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable? Peer Instruction 8 Classes and Objects How can multiple methods within a Java class read and write the same variable? A. Allow one method to reference a local variable of the other B. Declare a variable

More information

McGill University Faculty of Science School of Computer Science. MIDTERM EXAMINATION - Sample solutions. COMP-250: Introduction to Computer Science

McGill University Faculty of Science School of Computer Science. MIDTERM EXAMINATION - Sample solutions. COMP-250: Introduction to Computer Science STUDENT NAME: STUDENT ID: McGill University Faculty of Science School of Computer Science MIDTERM EXAMINATION - Sample solutions COMP-250: Introduction to Computer Science March 12, 2014 Examiner: Prof.

More information