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

Size: px
Start display at page:

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

Transcription

1 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 in the examination room and if doubt exists as to the interpretation of any problem, the candidate is urged to submit with the answer paper a clear statement of any assumptions made. Proctors are unable to respond to queries about the interpretation of exam questions. Do your best to answer exam questions as written. Please write your answers in the boxes provided. Extra space is available on the last page of the exam. The back of any page can be used for rough work. This exam is three hours long and refers exclusively to the use of the Java language. Comments are not required in the code you write. For full marks, code must be efficient as well as correct. This is a closed book exam. No computers or calculators are allowed. Student Number: Problem 1: / 40 Problem 4: / 10 Problem 2: / 20 Problem 5: / 10 Problem 3: / 10 Problem 6: / 50 TOTAL: / 140 This material is copyrighted and is for the sole use of students registered in CMPE212 and writing this exam. This material shall not be distributed or disseminated. Failure to abide by these conditions is a breach of copyright and may also constitute a breach of academic integrity under the University Senate's Academic Integrity Policy Statement.

2 Student Number: Page 2 of 24 Problem 1) [40 marks] Indicate if each of the following statements is True or False by writing a T or F on the line before the statement: Proper object encapsulation is based on having attributes declared as private. The implements keyword is used to create a child class from a parent class. The first line of code in the constructor of a child class must be a call to the constructor of the parent class. An immutable class has a mutator for each attribute. An attribute of type String must be cloned by its accessor to avoid a privacy leak. The keyword this can be used to access the immediate parent object from within the child object. A fully concrete child class must implement all abstract methods inherited from an abstract parent class. An interface can contain final static attributes. An object can be declared to be of an interface type. An abstract class can be instantiated. It is not possible to overload constructors. Only constructors can throw exceptions. The throws decoration is used in a class declaration to indicate that the class contains methods that throw exceptions. A constructor must be invoked during instantiation. Java automatically provides a default constructor for a class that does not have its own constructor.

3 Student Number: Page 3 of 24 Problem 1, Cont.) It is possible to define a class within another class. An outer class can only invoke non-static inner class methods from an instance of that inner class. A child class instance can be assigned to a pointer of a parent class type. Object is the base class for all classes in the Java API. Late binding is another name for the process of polymorphism. Early binding must be satisfied for the process of polymorphism to take place. Only attributes can be declared outside a class definition. In JavaFX, the root Pane class does not have a built-in layout manager algorithm. It can only use absolute layout positions. The StackPane class is used to place nodes in a grid layout. When using a GridPane, nodes can be added to any row, column position in any order. Visible grid lines can be used to help with layout when using a GridPane. By default, a GridPane column is set to be as wide as the widest node in that column. It is not possible to make a GridPane row any taller than the tallest node in that row. The relative positions of nodes within an HBox pane can change if the pane size changes. The relative positions of nodes within a TilePane can change if the pane size changes.

4 Student Number: Page 4 of 24 Problem 1, Cont.) A *.css file or stylesheet can be used to change the appearance of individual nodes, all nodes of a certain type or all nodes in a JavaFX window. Only one node can be the root node for a Scene object. All nodes must be added directly to the Stage object so that they can be seen. A JavaFX window is modal by default. An event handler to listen for a mouse click event can implement the EventHandler<ActionEvent> interface. The EventHandler<ActionEvent> interface is a functional interface. The root node is typically a Pane object. A Button s.setonaction() mutator can be used to attach an event handler to the button. It is not possible to use a Lambda function to define an event handler. A Lambda function can only contain a single line of code. A Lambda function can only be written for methods defined in a functional interface that accept a single argument. Settings made in the stylesheet will override any appearance settings made in the *.fxml file in the same JavaFX project. The *.fxml file must know the name and folder location of the controller *.java file that it is supposed to work with. Nodes must be instantiated in the controller *.java file rather than in the *.fxml file that it is associated with. The initialize() method in the controller *.java class is invoked only after all nodes have been injected into the file.

5 Student Number: Page 5 of 24 Problem 1, Cont.) annotation is used to specify methods and attributes in the controller class that are not to be processed by the *.fxml file. By default, built-in JavaFX dialog windows are modal in behaviour. It is not possible to change the graphic image used in a JavaFX dialog window. Dialogs cannot be used to obtain text from the user. Change listeners must be added to node properties rather than to the node itself. A change listener added to a text field property can obtain the text in the field as it was before it was changed by the user. Change listeners can be used to detect changes to spinners and sliders. Drawing methods can be invoked directly on an instance of a Canvas object. The border colour of a filled oval can be different from its fill colour. The (0, 0) pixel position in a Canvas object is the lower, left corner of the Canvas. The Canvas object is not capable of displaying images loaded from files. A Canvas object can interact with the cursor once an event handler has been added to the Canvas. A Transition animation can be used to animate several nodes at once. A Timeline animation can only be constructed with a single KeyFrame object. A Duration object must be supplied to the constructor of a KeyFrame object. A Duration object is used to specify the time delay between KeyFrame objects.

6 Student Number: Page 6 of 24 Problem 1, Cont.) An AnimationTimer object can be used to create an event that will be triggered every time the window s frame is re-drawn. An AnimationTimer object must be attached to a Timeline object. A Timeline object is started as soon as it is instantiated. A Timeline object cannot be halted until the application containing the object is closed. KeyFrame objects can be used to trigger events when the KeyFrame has completed. There is no point in designing an animation that updates at any rate higher than the monitor refresh rate. A loop that endlessly iterates until a second has passed and then re-starts can be added to the Application thread in a JavaFX program without changing the responsiveness of the window. A javafx.concurrent.task object cannot access scenegraph nodes directly, but must bind with their properties instead. A Task object cannot be re-started. A Task object is a generic class. The implementation of a Task object requires you to override the call() method that returns an object of type T. A javafx.concurrent.service object is used to manage a Task object. A Service object cannot be re-started. A Service object must be wrapped in a Thread object in order to be changed to a Daemon thread. Daemon threads are automatically halted before any user application threads are stopped. There is no way to change the thread priority of a thread in a JavaFX program.

7 Student Number: Page 7 of 24 Problem 1, Cont.) The Thread.sleep() method will not propagate a thread interrupt exception. The Thread.yield() method is used to halt a thread s execution. I am really happy that this is the last true/false question! Problem 2) [20 marks]: Answer the following questions as briefly as possible: What is the underlying data structure used by an ArrayList<T> collection? What is the convenience obtained by a class when it implements the Comparable<T> interface? What is the reason for making non-final attributes private? What is the advantage to declaring class members static? What is a null pointer?

8 Student Number: Page 8 of 24 Problem 2, Cont.) What does it mean to say that an exception is propagated after it is thrown? Name one advantage of using inheritance. Why is a try-with-resources block better than a normal try-catch block when used with File I/O? Which file format binary or text produces the most compact file for storing floating point numeric data and why? What is a Scene Graph as used in JavaFX?

9 Student Number: Page 9 of 24 Problem 3) [10 marks] Provide the console window output of each of the following println statements. If you think the statement will cause an error, write error instead. System.out.println ( 15 / 2.0 );... System.out.println ( (double)( 7 / 2 ) );... System.out.println ( 6 * ( 2 / 3 ) + 7 );... System.out.println ( true && 1 );... System.out.println ( 6 * 2 / );... System.out.println ( 6 * 20 / ( ) );... System.out.println ( 5 > 2 3 <= 1 );... System.out.println ( 2 ** 3 );... System.out.println ( 26 % 3 );... System.out.println ( * / 5-1 );... System.out.println ( true && 9!= 7 );... System.out.println ("4" );... System.out.println ( "7" - 4);... System.out.println ( 5 > 2 && 6!= 5 7 < 3 );... System.out.println ( <> 13 );... System.out.println ( 2.4 / (int) 1.2 );... System.out.println ( (int) ( 9.6 / 2.0 ) );... System.out.println ( > 3 && 9 >= );... System.out.println ( Character.isDigit("123") );... System.out.println ( Character.toLowerCase('B') );...

10 Student Number: Page 10 of 24 Problem 4) [10 marks] Write the output of the following complete program, which runs without error, in the box provided: public class Problem1 { public static double fiddle(int num1, int[] nums1, int[] nums2, String str) { str = str.tolowercase(); int size = str.length(); String flipped = str.charat(size 1) + str.substring(1, size 1) + str.charat(0); System.out.println(flipped); num1 = size; for (int num : nums1) num *= 10; System.out.println(nums1[0]); double sum = 0; for (int i = 0; i < nums2.length; i++) { sum += nums2[i]; nums2[i] *= 10; System.out.println(nums2[0]); return sum; // Displays numbers on one line public static void showarray(int[] array) { System.out.print("Array: "); for (int num : array) System.out.print(num + ", "); System.out.println(); public static void main(string[] args) { int[] array1 = {2, 3, 4, 5; int[] array2 = {1, 2, 3, 4; String astring = "Hello Class!"; int anum = 20; double aval = fiddle(anum, array1, array2, astring); System.out.println(aNum); showarray(array1); showarray(array2); System.out.println(aString); System.out.println(aVal);

11 Student Number: Page 11 of 24 Problem 5) [10 marks] Here are a bunch of classes and an interface from the same Java project: public abstract class Base { public int sum(int a, int b) { return a + b; public int multiply(int a, int b) { return a * b; public abstract int subtract(int a, int b); // end Base interface Dividing { int divide(int a, int b) throws DivideByZero; // end Dividing public class DivideByZero extends Exception { public DivideByZero(String message) { super(message); // end DivideByZero public class Concrete extends Missing { public int multiply(int a, int b, int c) { return a * b * c; // end Concrete There are two more classes in this project. The one on the next page contains a main method that tests the other classes:

12 Student Number: Page 12 of 24 Problem 5, Cont.) public class Demonstration { public static int remainder(int a, int b) { return a % b; public static void main(string[] args) { Concrete test = new Concrete(); // Prints: System.out.println(test.sum(4, 5)); // 9 System.out.println(test.sum(4, 5, 6)); // 15 System.out.println(remainder(12, 5)); // 2 System.out.println(test.multiply(4, 5)); // 20 System.out.println(test.multiply(3, 4, 5)); // 60 System.out.println(test.subtract(4, 5)); // 1 try { System.out.println(test.divide(10, 0)); catch (DivideByZero e) { System.out.println(e.getMessage()); //Attempt to divide by 0! try { System.out.println(test.divide(10, 2)); // 5 catch (DivideByZero e) { System.out.println(e.getMessage()); try { Dividing dtest = new Missing(); System.out.println(dTest.divide(15, 2)); // 7 catch (DivideByZero e) { System.out.println(e.getMessage()); // end main // end Demonstration As you can see the listing shown above contains the output of the program when run as in-line comments. One class is Missing. The Missing class extends one class and implements an interface. Write the Missing class on the next page:

13 Student Number: Page 13 of 24 Problem 5, Cont.)

14 Student Number: Page 14 of 24 Problem 6) [50 marks] For this problem you are going to write a properly encapsulated class call CallLog that is designed to hold data for a call centre s single phone call response. Start below by writing an exception class called LogException that will be used by the CallLog class: Write the LogException class below: 2 marks The CallLog class encapsulates the following attributes: The operator s name. Must contain at least one space and be at least three characters in length. The month for the call. An int that must lie between 1 and 12 inclusive. The day for the call. An int that must lie between 1 and 31 inclusive. The start time for the call as an int in the form hhmm, where hh is the hour that must be between 08 and 20 (8am to 8pm) and mm is the minute that must lie between 00 and 59. The finish time for the call in the same form as the start time. The finish time must be later than or the same as the start time. If an attempt is made to instantiate or mutate a CallLog instance with illegal arguments, the constructor or mutator being used must throw the LogException exception with an appropriate message. The CallLog class has one constructor that accepts arguments for all parameters and a second constructor that does not need the finish time, but assumes that the finish time is the same as the start time. Write a mutator for each attribute.

15 Student Number: Page 15 of 24 Problem 6, Cont.) You can write as many accessors as you need, but at a minimum you must have accessors for the name, the month and the day. As you continue to work on this problem you may find that additional accessors will help simplify your code. You also need to write the other four standard methods: compareto, equals, tostring and clone. Comparison using compareto is based just on the full starting time of the call. This means a time that consists of the month, the day and the starting time of the call. You will see examples of the use of this method later in the description of this problem. Equality is defined as the name, the month, the day and the starting time all being equal. You must override the equals method inherited from the Object class. You will see examples of the output of the tostring method later on in this description. The clone method must return a deep copy of the current CallLog object. All string comparisons in this problem can be assumed to be case sensitive. You can use the String methods.equals(otherstring) which returns a boolean and.compareto(otherstring) which returns a negative number if the supplied string comes after the current string (the one used to invoke the method) in the alphabet, zero if they are equal and a positive number if the supplied string comes before the current string. Start writing the CallLog class below and continue on the next five pages. Note that this problem continues after these five blank pages and that output examples are provided at the end of the problem statement. The CallLog class: 32 marks

16 Student Number: Page 16 of 24 Problem 6, Cont.) The CallLog class, Cont.:

17 Student Number: Page 17 of 24 Problem 6, Cont.) The CallLog class, Cont.:

18 Student Number: Page 18 of 24 Problem 6, Cont.) The CallLog class, Cont.:

19 Student Number: Page 19 of 24 Problem 6, Cont.) The CallLog class, Cont.:

20 Student Number: Page 20 of 24 Problem 6, Cont.) The CallLog class, Cont.:

21 Student Number: Page 21 of 24 Problem 6, Cont.) Imagine, but do not write (!), another class containing static methods that is using the CallLog object you have just completed. Also, imagine that there are other CallLog child type objects that extend your CallLog class that are designed to hold other pieces of information in addition to the ones you encapsulated above. In the box below, write a static method for inclusion in this class called totalcalltime that accepts as arguments: An ArrayList collection of objects of type CallLog or of any object that extends CallLog, An operator s name, A month as an int between 1 and 12, and A day as an int between 1 and 31. This method searches the supplied collection for all objects that have been created for the operator name supplied and for the supplied month and day. It then sums up and returns the total time in minutes for all calls that match the search criteria. If a call has the same finish time as the start time, assume a one minute duration for this call. Write just the totalcalltime method below. You may add accessor(s) to the CallLog class above in order to support the work of the totalcalltime method if you wish. The totalcalltime method: 6 marks

22 Student Number: Page 22 of 24 Problem 6, Cont.) Without all the javadoc comments the Comparable<T> interface from the Java API is: package java.lang; public interface Comparable<T> { public int compareto(t o); And the relevant part of the Comparator<T> interface is: package public interface Comparator<T> { int compare(t o1, T o2); The ArrayList.sort() method accepts a Comparator object that can be used to specify the sort criteria to be used by this method. Write a line of code to be included in some method in this other class that will sort an array list called loglist that is of type ArrayList<CallLog> using the ArrayList.sort() method. Note that if you supply null to the.sort() method it sorts using the natural ordering of the objects contained in the ArrayList. 1 mark Write another line of code that uses the ArrayList.sort() method with a Comparator object that changes the ordering to sort first by name then by time. Modify your CallLog class if you wish. 9 marks

23 Student Number: Page 23 of 24 Problem 6, Cont.) For example, here is the output generated by the code: loglist.foreach(item > System.out.println(item)) for some test data in the same order as it was added to the ArrayList loglist : Call log for Joe Keen on month 2, day 12, starting at 1005, finishing at 1010 Call log for Joe Keen on month 1, day 28, starting at 1005, finishing at 1010 Call log for Joe Keen on month 2, day 12, starting at 905, finishing at 912 Call log for Joe Keen on month 2, day 12, starting at 1407, finishing at 1410 Call log for Joe Keen on month 2, day 12, starting at 1225, finishing at 1227 Call log for Joe Keen on month 2, day 12, starting at 1358, finishing at 1405 Call log for Sue Keen on month 2, day 12, starting at 1005, finishing at 1010 Call log for Joe Keen on month 7, day 12, starting at 1005, finishing at 1010 Call log for Joe Keen on month 2, day 12, starting at 1005, finishing at 1005 Call log for Joe Keen on month 2, day 9, starting at 1105, finishing at 1110 Call log for Joe Keen on month 2, day 14, starting at 1005, finishing at 1010 Call log for Amy Keen on month 2, day 12, starting at 1005, finishing at 1010 The totalcalltime method, if invoked for Joe Keen, month 2 and day 12, would return the value of 25 minutes. After sorting using natural ordering, loglist would look like: Call log for Joe Keen on month 1, day 28, starting at 1005, finishing at 1010 Call log for Joe Keen on month 2, day 9, starting at 1105, finishing at 1110 Call log for Joe Keen on month 2, day 12, starting at 905, finishing at 912 Call log for Joe Keen on month 2, day 12, starting at 1005, finishing at 1010 Call log for Sue Keen on month 2, day 12, starting at 1005, finishing at 1010 Call log for Joe Keen on month 2, day 12, starting at 1005, finishing at 1005 Call log for Amy Keen on month 2, day 12, starting at 1005, finishing at 1010 Call log for Joe Keen on month 2, day 12, starting at 1225, finishing at 1227 Call log for Joe Keen on month 2, day 12, starting at 1358, finishing at 1405 Call log for Joe Keen on month 2, day 12, starting at 1407, finishing at 1410 Call log for Joe Keen on month 2, day 14, starting at 1005, finishing at 1010 Call log for Joe Keen on month 7, day 12, starting at 1005, finishing at 1010 After sorting with the new Comparator object: Call log for Amy Keen on month 2, day 12, starting at 1005, finishing at 1010 Call log for Joe Keen on month 1, day 28, starting at 1005, finishing at 1010 Call log for Joe Keen on month 2, day 9, starting at 1105, finishing at 1110 Call log for Joe Keen on month 2, day 12, starting at 905, finishing at 912 Call log for Joe Keen on month 2, day 12, starting at 1005, finishing at 1010 Call log for Joe Keen on month 2, day 12, starting at 1005, finishing at 1005 Call log for Joe Keen on month 2, day 12, starting at 1225, finishing at 1227 Call log for Joe Keen on month 2, day 12, starting at 1358, finishing at 1405 Call log for Joe Keen on month 2, day 12, starting at 1407, finishing at 1410 Call log for Joe Keen on month 2, day 14, starting at 1005, finishing at 1010 Call log for Joe Keen on month 7, day 12, starting at 1005, finishing at 1010 Call log for Sue Keen on month 2, day 12, starting at 1005, finishing at 1010

24 Student Number: Page 24 of 24 Extra Page

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 UNIVERSIY SCHOOL O COMPUING HAND IN Answers Are Recorded on Exam Paper CMPE212, WINER ERM, 2016 INAL EXAMINAION 9am to 12pm, 19 APRIL 2016 Instructor: Alan McLeod If the instructor is unavailable

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, FALL TERM, 2015 FINAL EXAMINATION 7pm to 10pm, 15 DECEMBER 2015 Instructor: Alan McLeod If the instructor

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 UNIVERSIY SCHOOL O COMPUING CISC124, ALL ERM, 2015 INAL EXAMINAION 7pm to 10pm, 15 DECEMBER 2015 Instructor: Alan McLeod HAND IN Answers Are Recorded on Question Paper SOLUION If the instructor

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

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

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 CMPE212, FALL TERM, 2012 FINAL EXAMINATION 18 December 2012, 2pm Instructor: Alan McLeod If the instructor is unavailable

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, 2011 FINAL EXAMINATION 7pm to 10pm, 26 APRIL 2011, Ross Gym Instructor: Alan McLeod If the instructor

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

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 CISC124, WINTER TERM, 2010 FINAL EXAMINATION 2pm to 5pm, 19 APRIL 2010, Dunning Hall Instructor: Alan McLeod

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

For example, here is a code snippet that supplies a legal data set to the constructor:

For example, here is a code snippet that supplies a legal data set to the constructor: Problem 1) [This problem is longer than what you will see on the quiz. You would not be asked to write as many methods, just one or two of them. This is still good practice, however!] For this problem

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, FALL TERM, 2013 FINAL EXAMINATION 7pm to 10pm, 18 DECEMBER 2013 Instructor: Alan McLeod If the instructor

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 SOLUTION 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

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, 2007 FINAL EXAMINATION 7pm to 10pm, 10 DECEMBER 2007, Jeffery Hall Instructor: Alan McLeod

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, 2007 FINAL EXAMINATION 7pm to 10pm, 10 DECEMBER 2007, Jeffery Hall Instructor: Alan McLeod If the

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 SOLUTION HAND IN Answers Are Recorded on Question Paper QUEEN'S UNIVERSITY SCHOOL OF COMPUTING CISC212, FALL TERM, 2004 FINAL EXAMINATION 9am to 12noon, 22 DECEMBER 2004 Instructors: Alan

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 CISC124, WINTER TERM, 2009 FINAL EXAMINATION 7pm to 10pm, 18 APRIL 2009, Dunning Hall Instructor: Alan McLeod If the

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 UNIVERSIY SCHOOL O COMPUING CISC124, WINER ERM, 2011 INAL EXAMINAION 7pm to 10pm, 26 APRIL 2011, Ross Gym HAND IN Answers Are Recorded on Question Paper SOLUION Instructor: Alan McLeod If the instructor

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 CISC212, FALL TERM, 2010 FINAL EXAMINATION 11 DECEMBER 2010, 9am SOLUTION HAND IN Answers Are Recorded on Question Paper Instructor: Alan McLeod If the instructor

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, 2009 FINAL EXAMINATION 14 DECEMBER 2009 Instructor: Alan McLeod If the instructor is unavailable

More information

This page intentionally left blank

This page intentionally left blank This page intentionally left blank Absolute Java, Global Edition Table of Contents Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents Chapter 1 Getting Started 1.1 INTRODUCTION

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 UNIVERSIY SCHOOL O COMPUING CMPE212, ALL ERM, 2011 INAL EXAMINAION 15 December 2011, 2pm, Grant Hall Instructor: Alan McLeod HAND IN Answers Are Recorded on Question Paper SOLUION If the instructor

More information

Language Features. 1. The primitive types int, double, and boolean are part of the AP

Language Features. 1. The primitive types int, double, and boolean are part of the AP Language Features 1. The primitive types int, double, and boolean are part of the AP short, long, byte, char, and float are not in the subset. In particular, students need not be aware that strings are

More information

Java Foundations. 9-1 Introduction to JavaFX. Copyright 2014, Oracle and/or its affiliates. All rights reserved.

Java Foundations. 9-1 Introduction to JavaFX. Copyright 2014, Oracle and/or its affiliates. All rights reserved. Java Foundations 9-1 Copyright 2014, Oracle and/or its affiliates. All rights reserved. Objectives This lesson covers the following objectives: Create a JavaFX project Explain the components of the default

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, 2008 FINAL EXAMINATION 7pm to 10pm, 17 DECEMBER 2008, Grant Hall Instructor: Alan McLeod

More information

COMP 250 Winter 2011 Reading: Java background January 5, 2011

COMP 250 Winter 2011 Reading: Java background January 5, 2011 Almost all of you have taken COMP 202 or equivalent, so I am assuming that you are familiar with the basic techniques and definitions of Java covered in that course. Those of you who have not taken a COMP

More information

Module Contact: Dr Gavin Cawley, CMP Copyright of the University of East Anglia Version 1

Module Contact: Dr Gavin Cawley, CMP Copyright of the University of East Anglia Version 1 UNIVERSITY OF EAST ANGLIA School of Computing Sciences Main Series UG Examination 2017-18 PROGRAMMING 1 CMP-4008Y Time allowed: 2 hours Answer FOUR questions. All questions carry equal weight. Notes are

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

1 Shyam sir JAVA Notes

1 Shyam sir JAVA Notes 1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write

More information

CS506 Web Design & Development Final Term Solved MCQs with Reference

CS506 Web Design & Development Final Term Solved MCQs with Reference with Reference I am student in MCS (Virtual University of Pakistan). All the MCQs are solved by me. I followed the Moaaz pattern in Writing and Layout this document. Because many students are familiar

More information

Objects and Iterators

Objects and Iterators Objects and Iterators Can We Have Data Structures With Generic Types? What s in a Bag? All our implementations of collections so far allowed for one data type for the entire collection To accommodate a

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

CMSC132 Summer 2018 Midterm 1

CMSC132 Summer 2018 Midterm 1 CMSC132 Summer 2018 Midterm 1 First Name (PRINT): Last Name (PRINT): Instructions This exam is a closed-book and closed-notes exam. Total point value is 100 points. The exam is a 80 minutes exam. Please

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

CO Java SE 8: Fundamentals

CO Java SE 8: Fundamentals CO-83527 Java SE 8: Fundamentals Summary Duration 5 Days Audience Application Developer, Developer, Project Manager, Systems Administrator, Technical Administrator, Technical Consultant and Web Administrator

More information

CSE 142 Su01 Final Exam Sample Solution page 1 of 7

CSE 142 Su01 Final Exam Sample Solution page 1 of 7 CSE 142 Su01 Final Exam Sample Solution page 1 of 7 Answer all of the following questions. READ EACH QUESTION CAREFULLY. Answer each question in the space provided on these pages. Budget your time so you

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

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

Event-Driven Programming with GUIs. Slides derived (or copied) from slides created by Rick Mercer for CSc 335

Event-Driven Programming with GUIs. Slides derived (or copied) from slides created by Rick Mercer for CSc 335 Event-Driven Programming with GUIs Slides derived (or copied) from slides created by Rick Mercer for CSc 335 Event Driven GUIs A Graphical User Interface (GUI) presents a graphical view of an application

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

Computer Science II (20073) Week 1: Review and Inheritance

Computer Science II (20073) Week 1: Review and Inheritance Computer Science II 4003-232-01 (20073) Week 1: Review and Inheritance Richard Zanibbi Rochester Institute of Technology Review of CS-I Hardware and Software Hardware Physical devices in a computer system

More information

CMSC 341. Nilanjan Banerjee

CMSC 341. Nilanjan Banerjee CMSC 341 Nilanjan Banerjee http://www.csee.umbc.edu/~nilanb/teaching/341/ Announcements Just when you thought Shawn was going to teach this course! On a serious note: register on Piazza I like my classes

More information

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM)

DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR (ODD SEM) DHANALAKSHMI SRINIVASAN COLLEGE OF ENGINEERING AND TECHNOLOGY ACADEMIC YEAR 2018-19 (ODD SEM) DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING SUB: OBJECT ORIENTED PROGRAMMING SEM/YEAR: III SEM/ II YEAR

More information

VALLIAMMAI ENGINEERING COLLEGE

VALLIAMMAI ENGINEERING COLLEGE VALLIAMMAI ENGINEERING COLLEGE SRM Nagar, Kattankulathur 60 0 DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK III SEMESTER CS89- Object Oriented Programming Regulation 07 Academic Year 08 9 Prepared

More information

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University

Day 4. COMP1006/1406 Summer M. Jason Hinek Carleton University Day 4 COMP1006/1406 Summer 2016 M. Jason Hinek Carleton University today s agenda assignments questions about assignment 2 a quick look back constructors signatures and overloading encapsulation / information

More information

Murach s Beginning Java with Eclipse

Murach s Beginning Java with Eclipse Murach s Beginning Java with Eclipse Introduction xv Section 1 Get started right Chapter 1 An introduction to Java programming 3 Chapter 2 How to start writing Java code 33 Chapter 3 How to use classes

More information

CS 251 Intermediate Programming Inheritance

CS 251 Intermediate Programming Inheritance CS 251 Intermediate Programming Inheritance Brooke Chenoweth University of New Mexico Spring 2018 Inheritance We don t inherit the earth from our parents, We only borrow it from our children. What is inheritance?

More information

Fall 2017 CISC124 9/16/2017

Fall 2017 CISC124 9/16/2017 CISC124 Labs start this week in JEFF 155: Meet your TA. Check out the course web site, if you have not already done so. Watch lecture videos if you need to review anything we have already done. Problems

More information

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries

Syllabus & Curriculum for Certificate Course in Java. CALL: , for Queries 1 CONTENTS 1. Introduction to Java 2. Holding Data 3. Controllin g the f l o w 4. Object Oriented Programming Concepts 5. Inheritance & Packaging 6. Handling Error/Exceptions 7. Handling Strings 8. Threads

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

Inheritance. Inheritance allows the following two changes in derived class: 1. add new members; 2. override existing (in base class) methods.

Inheritance. Inheritance allows the following two changes in derived class: 1. add new members; 2. override existing (in base class) methods. Inheritance Inheritance is the act of deriving a new class from an existing one. Inheritance allows us to extend the functionality of the object. The new class automatically contains some or all methods

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

Fall 2017 CISC124 10/1/2017

Fall 2017 CISC124 10/1/2017 CISC124 Today First onq quiz this week write in lab. More details in last Wednesday s lecture. Repeated: The quiz availability times will change to match each lab as the week progresses. Useful Java classes:

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

CSCI 201L Written Exam #1 Fall % of course grade

CSCI 201L Written Exam #1 Fall % of course grade Final Score /15 Name SOLUTION ID Extra Credit /0.5 Lecture Section (circle one): TTh 8:00-9:20 TTh 9:30-10:50 TTh 11:00-12:20 CSCI 201L Written Exam #1 Fall 2017 15% of course grade The exam is one hour

More information

CS 116. Lab Assignment # 1 1

CS 116. Lab Assignment # 1 1 Points: 2 Submission CS 116 Lab Assignment # 1 1 o Deadline: Friday 02/05 11:59 PM o Submit on Blackboard under assignment Lab1. Please make sure that you click the Submit button and not just Save. Late

More information

CSCI-142 Exam 1 Review September 25, 2016 Presented by the RIT Computer Science Community

CSCI-142 Exam 1 Review September 25, 2016 Presented by the RIT Computer Science Community CSCI-12 Exam 1 Review September 25, 2016 Presented by the RIT Computer Science Community http://csc.cs.rit.edu 1. Provide a detailed explanation of what the following code does: 1 public boolean checkstring

More information

ENCAPSULATION AND POLYMORPHISM

ENCAPSULATION AND POLYMORPHISM MODULE 3 ENCAPSULATION AND POLYMORPHISM Objectives > After completing this lesson, you should be able to do the following: Use encapsulation in Java class design Model business problems using Java classes

More information

Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010

Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010 Second Exam Computer Programming 326 Dr. St. John Lehman College City University of New York Thursday, 11 November 2010 NAME (Printed) NAME (Signed) E-mail Exam Rules Show all your work. Your grade will

More information

TeenCoder : Java Programming (ISBN )

TeenCoder : Java Programming (ISBN ) TeenCoder : Java Programming (ISBN 978-0-9887070-2-3) and the AP * Computer Science A Exam Requirements (Alignment to Tennessee AP CS A course code 3635) Updated March, 2015 Contains the new 2014-2015+

More information

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline :: Module Title Duration : Intro to JAVA SE7 and Programming using JAVA SE7 : 9 days Course Description The Java SE 7 Fundamentals course was designed to enable students with little or no programming experience

More information

Java SE 8 Programming

Java SE 8 Programming Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 67863102 Java SE 8 Programming Duration: 5 Days What you will learn This Java SE 8 Programming training covers the core language features

More information

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started

Application Development in JAVA. Data Types, Variable, Comments & Operators. Part I: Core Java (J2SE) Getting Started Application Development in JAVA Duration Lecture: Specialization x Hours Core Java (J2SE) & Advance Java (J2EE) Detailed Module Part I: Core Java (J2SE) Getting Started What is Java all about? Features

More information

CMSC132 Summer 2018 Midterm 1. Solution

CMSC132 Summer 2018 Midterm 1. Solution CMSC132 Summer 2018 Midterm 1 Solution First Name (PRINT): Last Name (PRINT): Instructions This exam is a closed-book and closed-notes exam. Total point value is 100 points. The exam is a 80 minutes exam.

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

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours

Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Course Overview This course teaches programmers the skills necessary to create Java programming system applications and satisfies the

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

CSCI-142 Exam 2 Review September 25, 2016 Presented by the RIT Computer Science Community

CSCI-142 Exam 2 Review September 25, 2016 Presented by the RIT Computer Science Community CSCI-142 Exam 2 Review September 25, 2016 Presented by the RIT Computer Science Community http://csc.cs.rit.edu 1. Suppose we are talking about the depth-first search (DFS) algorithm. Nodes are added to

More information

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am

CMSC 202 Section 010x Spring Justin Martineau, Tuesday 11:30am CMSC 202 Section 010x Spring 2007 Computer Science II Final Exam Name: Username: Score Max Section: (check one) 0101 - Justin Martineau, Tuesday 11:30am 0102 - Sandeep Balijepalli, Thursday 11:30am 0103

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 CISC124, WINTER TERM, 2009 FINAL EXAMINATION 7pm to 10pm, 18 APRIL 2009, Dunning Hall Instructor: Alan McLeod

More information

Index COPYRIGHTED MATERIAL

Index COPYRIGHTED MATERIAL Index COPYRIGHTED MATERIAL Note to the Reader: Throughout this index boldfaced page numbers indicate primary discussions of a topic. Italicized page numbers indicate illustrations. A abstract classes

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

OBJECT ORIENTED PROGRAMMING TYm. Allotted : 3 Hours Full Marks: 70

OBJECT ORIENTED PROGRAMMING TYm. Allotted : 3 Hours Full Marks: 70 I,.. CI/. T.cH/C8E/ODD SEM/SEM-5/CS-504D/2016-17... AiIIIII "-AmI u...iir e~ IlAULAKA ABUL KALAM AZAD UNIVERSITY TECHNOLOGY,~TBENGAL Paper Code: CS-504D OF OBJECT ORIENTED PROGRAMMING TYm. Allotted : 3

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

This page intentionally left blank

This page intentionally left blank This page intentionally left blank arting Out with Java: From Control Structures through Objects International Edition - PDF - PDF - PDF Cover Contents Preface Chapter 1 Introduction to Computers and Java

More information

Introduction to Computing II (ITI 1121) Final Examination

Introduction to Computing II (ITI 1121) Final Examination Université d Ottawa Faculté de génie École de science informatique et de génie électrique University of Ottawa Faculty of Engineering School of Electrical Engineering and Computer Science Introduction

More information

Computer Science II (20082) Week 1: Review and Inheritance

Computer Science II (20082) Week 1: Review and Inheritance Computer Science II 4003-232-08 (20082) Week 1: Review and Inheritance Richard Zanibbi Rochester Institute of Technology Review of CS-I Syntax and Semantics of Formal (e.g. Programming) Languages Syntax

More information

Software Systems Development Unit AS1: Introduction to Object Oriented Development

Software Systems Development Unit AS1: Introduction to Object Oriented Development New Specification Centre Number 71 Candidate Number ADVANCED SUBSIDIARY (AS) General Certificate of Education 2014 Software Systems Development Unit AS1: Introduction to Object Oriented Development [A1S11]

More information

Introduction to Programming System Design CSCI 455x (4 Units)

Introduction to Programming System Design CSCI 455x (4 Units) Introduction to Programming System Design CSCI 455x (4 Units) Description This course covers programming in Java and C++. Topics include review of basic programming concepts such as control structures,

More 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

QUEEN MARY, UNIVERSITY OF LONDON DCS128 ALGORITHMS AND DATA STRUCTURES Class Test Monday 27 th March

QUEEN MARY, UNIVERSITY OF LONDON DCS128 ALGORITHMS AND DATA STRUCTURES Class Test Monday 27 th March QUEEN MARY, UNIVERSITY OF LONDON DCS128 ALGORITHMS AND DATA STRUCTURES Class Test Monday 27 th March 2006 11.05-12.35 Please fill in your Examination Number here: Student Number here: MODEL ANSWERS All

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

1. (5 points) In your own words, describe what an instance is.

1. (5 points) In your own words, describe what an instance is. SE1021 Exam 2 Name: 1. (5 points) In your own words, describe what an instance is. 2. (5 points) Consider the Apple class in the UML diagram on the right. Write a couple lines of code to call the instance

More information

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance

Contents. I. Classes, Superclasses, and Subclasses. Topic 04 - Inheritance Contents Topic 04 - Inheritance I. Classes, Superclasses, and Subclasses - Inheritance Hierarchies Controlling Access to Members (public, no modifier, private, protected) Calling constructors of superclass

More information

Multimedia-Programmierung Übung 3

Multimedia-Programmierung Übung 3 Multimedia-Programmierung Übung 3 Ludwig-Maximilians-Universität München Sommersemester 2015 JavaFX Version 8 What is JavaFX? Recommended UI-Toolkit for Java 8 Applications (like e.g.: Swing, AWT) Current

More information

Class, Variable, Constructor, Object, Method Questions

Class, Variable, Constructor, Object, Method Questions Class, Variable, Constructor, Object, Method Questions http://www.wideskills.com/java-interview-questions/java-classes-andobjects-interview-questions https://www.careerride.com/java-objects-classes-methods.aspx

More information

Java SE 8 Programming

Java SE 8 Programming Oracle University Contact Us: +52 1 55 8525 3225 Java SE 8 Programming Duration: 5 Days What you will learn This Java SE 8 Programming training covers the core language features and Application Programming

More information

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University

Cpt S 122 Data Structures. Course Review FINAL. Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 Data Structures Course Review FINAL Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Final When: Wednesday (12/12) 1:00 pm -3:00 pm Where: In Class

More information

3. Can an abstract class include both abstract methods and non-abstract methods? D

3. Can an abstract class include both abstract methods and non-abstract methods? D Assignment 13 Abstract Classes and Polymorphism CSC 123 Fall 2018 Answer Sheet Short Answers. Multiple Choice 1. What is an abstract class? C A. An abstract class is one without any child classes. B. An

More information

Java Fundamentals (II)

Java Fundamentals (II) Chair of Software Engineering Languages in Depth Series: Java Programming Prof. Dr. Bertrand Meyer Java Fundamentals (II) Marco Piccioni static imports Introduced in 5.0 Imported static members of a class

More information

Java Class Design. Eugeny Berkunsky, Computer Science dept., National University of Shipbuilding

Java Class Design. Eugeny Berkunsky, Computer Science dept., National University of Shipbuilding Java Class Design Eugeny Berkunsky, Computer Science dept., National University of Shipbuilding eugeny.berkunsky@gmail.com http://www.berkut.mk.ua Objectives Implement encapsulation Implement inheritance

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

Java Programming Fundamentals

Java Programming Fundamentals Java Programming Fundamentals Course JAVAB Five Days Instructor-led Hands on This five-day, instructor-led course helps any programmer learn Java faster and better than ever before: It's the one Java course

More information

Throughout the exam, write concisely and underline key words or phrases. Have fun! Exam 2. Week 7 (Winter 2013). Dr. Yoder. Sec 031.

Throughout the exam, write concisely and underline key words or phrases. Have fun! Exam 2. Week 7 (Winter 2013). Dr. Yoder. Sec 031. SE1021 Exam 2 Name: You may have an 8.5x11 note sheet for this exam. No calculators or other study aids on this exam. Write your initials at the tops of the following pages and read through the exam before

More information

Sri Vidya College of Engineering & Technology

Sri Vidya College of Engineering & Technology UNIT I INTRODUCTION TO OOP AND FUNDAMENTALS OF JAVA 1. Define OOP. Part A Object-Oriented Programming (OOP) is a methodology or paradigm to design a program using classes and objects. It simplifies the

More information

Composite Pattern Diagram. Explanation. JavaFX Subclass Hierarchy, cont. JavaFX: Node. JavaFX Layout Classes. Top-Level Containers 10/12/2018

Composite Pattern Diagram. Explanation. JavaFX Subclass Hierarchy, cont. JavaFX: Node. JavaFX Layout Classes. Top-Level Containers 10/12/2018 Explanation Component has Operation( ), which is a method that applies to all components, whether composite or leaf. There are generally many operations. Component also has composite methods: Add( ), Remove(

More information

The Sun s Java Certification and its Possible Role in the Joint Teaching Material

The Sun s Java Certification and its Possible Role in the Joint Teaching Material The Sun s Java Certification and its Possible Role in the Joint Teaching Material Nataša Ibrajter Faculty of Science Department of Mathematics and Informatics Novi Sad 1 Contents Kinds of Sun Certified

More information

University of Cape Town ~ Department of Computer Science Computer Science 1015F ~ June Exam

University of Cape Town ~ Department of Computer Science Computer Science 1015F ~ June Exam Name: Please fill in your Student Number and Name. Student Number : Student Number: University of Cape Town ~ Department of Computer Science Computer Science 1015F ~ 2009 June Exam Question Max Internal

More information

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

Ryerson University Department of Electrical & Computer Engineering COE618 Midterm Examination February 26, 2013 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

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