CIS Introduction to Computer Programming Spring Exam 2
|
|
- Olivia Kelley
- 6 years ago
- Views:
Transcription
1 CIS Introduction to Computer Programming Spring Exam 2 Name: Recitation (e.g. 201): PennKey (e.g. eeaton): My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity in completing this examination. Signature Date Instructions Do not open this exam until told by the proctor. You will have 110 minutes to finish it. There are 110 total points. Make sure your phone is turned OFF (not to vibrate!) before the exam. Food, gum, and drink are prohibited. You may not use your phone or open your bag for any reason, including to retrieve or put away pens or pencils, until you have left the exam room. This exam is closed-book, closed-notes, and closed computational devices. If you get stuck on a problem, it may be to your benefit to move on to another question and come back later. All answers must be written on the exam booklet; answers written on scrap paper will not be counted. All code must be written in proper Java, including all curly braces and semicolons. Do not separate the pages. Re-attach any loose pages with the provided staplers. Staple all scratch paper to your exam. Do not take any sheets of paper with you. If you require extra paper, please use the backs of the exam pages or the extra pages provided at the end of the exam. Clearly indicate on the question page where the graders can find the remainder of your work (e.g., back of page or on extra sheet ). Use only a pencil, or blue or black pen. If you have any questions, raise your hand and a proctor will come to answer them. When you turn in your exam, you must show ID. If you forgot to bring your ID, talk to an exam proctor immediately. We wish you the best of luck. 1
2 1 Miscellaneous (15 pts total) 1. (1 pt) Do the following: Check that your exam has all 15 pages (including the cover sheet and scratch paper). Write your name, recitation number, and PennKey (username) on the front of the exam. Put your initials on the top right corner of each page of the exam Sign the certification that you comply with the Penn Academic Integrity Code. To show you did it, what was your favorite assignment from the second half of the course? (A) Harper s Bazaar (C) Traveling Salesman (B) Steganography (D) I m looking forward to the course project! 2. (2 pts) A class can have multiple constructors (A) True (B) False 3. (2 pts) Convert the decimal number 93 to binary (A) (B) (C) (D) (E) None of the above 4. (2 pts) Every well-written recursive method must include: (A) A while loop (C) A conditional (E) None of the above (B) A for loop (D) A global variable 5. (2 pts) Assume you re writing a program where the amount of the data is constantly changing and memory usage should always be minimal. Which is the best data structure to use? (A) Array (B) ArrayList (C) LinkedList (D) None of the above 6. (2 pts) Consider a StudentRecord class that represents the record for a CIS 110 student. A method getnumabsences() (which returns a student s total absences) should be declared: (A) Static (B) Non-static (C) Either 7. (2 pts) Which of the following expressions is true? (A) ((0 1) & 1) == ((0 ^ 0) & 1) (B) ((1 ^ 0) & 0) == ((1 ^ 1) 1) (C) ((0 & 1) 1) == ((0 ^ 0) & 1) (D) ((0 ^ 1) & 1) == ((0 1) & (0 1)) (E) None of the above 8. (2 pts) Suppose p and q are both nodes in a linked list of strings. What happens when the expression p == q is evaluated? (A) The expression is true if and only if p and q refer to nodes that contain the same string values (B) The expression is true if and only if p and q refer to nodes that contain the same string and next values (C) The expression is true if and only if p and q refer to the same object instance (D) The expression is false (E) A compiler or runtime error 2
3 2 Object Oriented Design (12 pts total) In the game PACMAN, the user navigates PACMAN through the maze while eating the small dots and avoiding the multi-colored ghosts. If PACMAN eats the larger power-up circles, the ghosts color changes to blue and PAC- MAN can temporarily eat the ghosts, sending them back to the maze center. You decide to implement PACMAN using the four objects below, which will be used within a separate PacmanGame class that will control the environment and overall game. Design the public API for each object, supporting all aspects necessary to implement the game as shown to the right. Specify the return type and signature for each method. Do not specify fields or private methods. Pacman Ghost Dot PowerUp 3
4 3 Debugging (17 pts total) A company has implemented two objects: Project and Team. The code on the next page is supposed to help the company add employees to teams and assign projects to teams. Unfortunately, this is not a tech company and their code doesn t completely work. First off, find the four bugs in the existing lines of code. Be sure to give the line number, and completely re-write the one line of code to fix the bug. (2 pts each) Bug 1: Line Bug 2: Line Bug 3: Line Bug 4: Line With these fixes, the code will usually work, but it will sometimes fail. There are still bugs caused by omitted code. Specifically, Project doesn t consider edge cases in the methods below. Add the missing lines of code and specify line numbers where the code should be inserted. As an example of such edge cases, see lines (3 pts each) In addteammember(): In getcurrentproject(): In getnextproject(): 4
5 1 public class Company { 2 3 public class P r o j e c t { 4 S t r i n g projectname ; 5 S t r i n g projectlead ; 6 int weekstocomplete ; 7 P r o j e c t n e x t P r o j e c t ; 8 9 public P r o j e c t ( S t r i n g name, S t r i n g lead, int weeks ) { 10 i f (name. l e n g t h ( ) == 0 name == n u l l ) 11 throw new IllegalArgumentException ( I n v a l i d name ) ; 12 i f ( l e a d == n u l l l e a d. l e n g t h ( ) == 0) 13 throw new IllegalArgumentException ( I n v a l i d l e a d ) ; 14 i f ( weeks < 0) 15 throw new IllegalArgumentException ( weeks cannot be n e g a t i v e ) ; 16 projectname = name ; 17 projectlead = name ; 18 weekstocomplete = weeks ; 19 n e x t P r o j e c t = n u l l ; public void setnext ( P r o j e c t n e x t P r o j e c t ) { 23 this. n e x t P r o j e c t = n e x t P r o j e c t ; public S t r i n g t o S t r i n g ( ) { 27 return projectname + l e d by + projectlead + w i l l be 28 + completed i n + weekstocomplete + weeks. ; public class Team { 33 S t r i n g manager ; 34 int nummembers = 0 ; 35 S t r i n g [ ] teammembers ; 36 P r o j e c t p r o j e c t s = n u l l ; public Team( S t r i n g manager ) { 39 manager = manager ; 40 S t r i n g [ ] teammembers = new S t r i n g [ 1 0 ] ; // max 10 p e o p l e on a team public void addteammember( S t r i n g name) { 44 teammembers [ nummembers++] = name ; public void addproject ( S t r i n g projname, S t r i n g projlead, int weeks ) { 48 p r o j e c t s. setnext (new P r o j e c t ( projname, projlead, weeks ) ) ; public S t r i n g g e t C u r r e n t P r o j e c t ( ) { 52 return p r o j e c t s. t o S t r i n g ( ) ; public S t r i n g getnextproject ( ) { 56 return p r o j e c t s. n e x t P r o j e c t. t o S t r i n g ( ) ;
6 4 Vowel Reverso, Vowel Reverso (15 pts total) Write a function that takes in a String and reverses the order of all vowels {a, e, i, o, u in the String. For example, HELLO would become HOLLE, and aeioudy would become uoieady. Be sure to test that the input is a valid string, and otherwise return null. Assume that you have access to a static function boolean isvowel(char c) that returns whether or not the given character is a vowel. 6
7 5 Sorting Mixup (9 pts total) Unsorted Method Unsorted Method Unsorted Method The leftmost column in the tables above is an array of ints to be sorted. The right-side column gives the contents of the array during some intermediate step of either insertion sort, merge sort, selection sort, or none of the above. Match each method with its sole corresponding algorithm (or write None ); you may use each sorting algorithm more than once. Write your answer next to the corresponding method below. Method 1: Method 2: Method 3: 7
8 6 2D Arrays (10 pts total) Last night, you stayed up late to make progress on a CIS110 homework assignment. Upon waking this morning, you can no longer decipher your comment-less code. You decide to trace through a few examples to get an idea of what the code does. public static int[][] order(int[][] grid) { for (int i = 0; i < grid.length-1; i++) { for (int j = 0; j < grid[i].length-1; j++) { if (grid[i][j] > grid[i][j+1]) { int temp = grid[i][j+1]; grid[i][j+1] = grid[i][j]; grid[i][j] = temp; if (grid[i][0] > grid[i+1][0]) { int[] temp = grid[i]; grid[i] = grid[i+1]; grid[i+1] = temp; return grid; 1. (3 pts) What array will order() return when called on the following 2D array: ? 2. (3 pts) What will order() return when called on the following 2D array: ? 8
9 3. (4 pts) After hours of debugging, you finally realize what you were trying to do. You wanted to sort the numbers in each row from smallest to largest (ascending order), and then rearrange the sorted rows so that the numbers in the leftmost column are also in ascending order. You rewrite your code, and it works as intended! Fill in the blanks to complete your fixed code: public static orderfixed(int[][] grid) { for (int i = 0; i < grid.length; i++) { for (int j = 0; j < ; j++) { int minidx = ; for (int k = j; k < ; k++) { if (grid[i][k] < grid[i][minidx]) { minidx = ; int temp = grid[i][j]; = grid[i][minidx]; grid[i][minidx] = temp; for (int i = 0; i < ; i++) { if (grid[i][0] > grid[i+1][0]) { temp = grid[i]; grid[i] = grid[i+1]; grid[i+1] = temp; return grid; 9
10 7 Objects (16 pts total) You decide to build a game for your CIS110 project. The game is a grid on which there are Players, Rocks, and Holes. Each Player begins with a 100 health points. When a Player comes in contact with a Rock, the player s health decreases by 20%. When a Player comes in contact with a Hole, they fall in and die. When a Player comes in contact with another Player, both players take a hit of 40 pts to their health. If at any point a Player s health hits 0 (or lower), they die. A Player is considered an active Player while they are alive in the game. The number of active Players is the total number of Players alive on the grid. Write the missing parts specified by blank lines or empty methods in class Player: public static class Player { private String name; private int health; private boolean alive; activeplayers = 0; public Player(String name) { public int gethealth() { return health; public void sethealth(int health) { this.health = health; getactiveplayers() { return activeplayers; public void die() { 10
11 public void encounter(hole h) { public void encounter(rock r) { public void encounter(player p) { //end Player class definition (2 pts) Which Java feature allows us to have several encounter methods with different arguments? 11
12 8 Linked Data Structures (16 pts total) A doubly-linked list is a sequence of nodes where each Node object contains an item, a reference to the next node in the list, and a pointer to the previous node in the list. The Node class is defined below. Note that this DoublyLinkedList class deliberately omits a tail reference. Write a function to efficiently check whether the doubly-linked list is a palindrome. Recall that a palindrome is a sequence that reads the same forwards and backwards. For example: You should assume that the rest of the DoublyLinkedList class is implemented correctly, so head and size will be accurate. public class DoublyLinkedList { private Node head; private int size; private class Node { public int item; public Node next; public Node prev; // other DoublyLinkedList methods //... public boolean ispalindrome() { //implement on the next page 12
13 /** * ispalindrome: determines if the doubly linked list is a palindrome. true if the list is a palindrome, or * false if the list isn t a palindrome or if head is null */ public boolean ispalindrome() { 13
14 Scratch Paper 14
15 Scratch Paper 15
16 Answer Key Section 1: 1. ANY 2. A 3. B 4. C 5. C 6. B 7. D 8. C Section 2: Pacman public Pacman(double x, double y); public double getx(); public double gety(); public void draw(); public void update(direction d); Dot public Dot(double x, double y); public double getx(); public double gety(); public void draw(); public boolean collision(pacman p); Ghost public Ghost(); public double getx(); public double gety(); public void draw(); public void update(); public boolean collision(pacman p); PowerUp public PowerUp(double x, double y); public double getx(); public double gety(); public void draw(); public boolean collision(pacman p); Section 3: Bugs: 1. Line 10: check name == null before name.length() == null 2. Line 17: projectlead = lead, not projectlead = name; 3. Line 39: this.manager = manager, not manger = manager; 4. Line 40: teammembers = new String[10], not String[] teammembers = new String[10]; Omitted Code: 1. addteammember() - before line: 44 if (nummembers == 10) throw new Exception("team is full"); 2. getcurrentproject() before line 52: if(projects == null) return null; 3. getnextproject() before line 56: if (projects == null projects.next == null) return null; 16
17 Section 4: ANSWER: public static String reversevowels(string str) { // get string of vowels String vowels = ""; for (int i=0; i<str.length(); i++) { char c = str.charat(i); if (isvowel(c)) vowels += c; // rebuild original string with vowels reversed int vowelidx = vowels.length()-1; String answer = ""; for (int i=0; i<str.length(); i++) { char c = str.charat(i); if (isvowel(c)) answer += vowels.charat(vowelidx--); else answer += c; return answer; Section 5: Answers: A: Merge, B: Insertion, C: Selection Section 6:
18 4. public static int[][] orderfixed(int[][] grid) { for (int i = 0; i < grid.length; i++) { for (int j = 0; j < grid[i].length-1; j++) { int minidx = j; for (int k = j; k < grid[i].length; k++) { if (grid[i][k] < grid[i][minidx]) { minidx = k; int temp = grid[i][j]; grid[i][j] = grid[i][minidx]; grid[i][minidx] = temp; for (int i = 0; i < grid.length-1; i++) { if (grid[i][0] > grid[i+1][0]) { int[] temp = grid[i]; grid[i] = grid[i+1]; grid[i+1] = temp; return grid; Section 7: public static class Player { private String name; private int health; private boolean alive; private static int activeplayers = 0; public Player(String name) { this.name = name; health = 100; alive = true; activeplayers++; public int gethealth() { return health; 18
19 public void sethealth(int health) { this.health = health; public static int getactiveplayers() { return activeplayers; public void die() { alive = false; activeplayers--; public void encounter(hole h) { die(); public void encounter(rock r) { health = (int) (health * 0.8); public void encounter(player p) { //other person p.sethealth(p.gethealth() - 40); if (p.gethealth() <= 0) { p.die(); //myself health = health - 40; if (health <= 0) { die(); Answer to last question: overloading 19
20 Section 8: Solution 1 using the size of the linked list: public boolean ispalindrome() { if (head == null) { return false; Node last = head; while (last.next!= null) { last = last.next; int i = 0; while (i < size / 2) { if (head.item!= last.item) { return false; head = head.next; last = last.prev; i++; return true; Solution 2 without using the size of the linked list: public boolean ispalindrome() { if (head == null) { return false; Node last = head; while (last.next!= null) { last = last.next; while (head!= last) { if (head.item!= last.item) { return false; head = head.next; last = last.prev; return true; 20
CIS 110 Introduction to Computer Programming 8 October 2013 Midterm
CIS 110 Introduction to Computer Programming 8 October 2013 Midterm Name: Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS Introduction to Computer Programming Spring Exam 1
CIS 110 - Introduction to Computer Programming Spring 2017 - Exam 1 Name: Recitation (e.g. 201): PennKey (e.g. eeaton): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Introduction to Computer Programming Summer 2016 Midterm. Recitation # (e.g., 201):
CIS 110 Introduction to Computer Programming Summer 2016 Midterm Name: Recitation # (e.g., 201): Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Fall 2014 Introduction to Computer Programming 8 Oct 2014 Midterm Exam Name:
CIS 110 Fall 2014 Introduction to Computer Programming 8 Oct 2014 Midterm Exam Name: Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the University
More informationCIS 110 Introduction to Computer Programming Spring 2016 Midterm
CIS 110 Introduction to Computer Programming Spring 2016 Midterm Name: Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Introduction to Computer Programming. 13 February 2013 Make-Up Midterm Midterm
CIS 110 Introduction to Computer Programming 13 February 2013 Make-Up Midterm Midterm Name: Recitation # (e.g. 201): Pennkey (e.g. bjbrown): My signature below certifies that I have complied with the University
More informationCIS 110 Introduction to Computer Programming Summer 2018 Final. Recitation # (e.g., 201):
CIS 110 Introduction to Computer Programming Summer 2018 Final Name: Recitation # (e.g., 201): Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Introduction to Computer Programming. 12 February 2013 Midterm
CIS 110 Introduction to Computer Programming 12 February 2013 Midterm Name: Recitation # (e.g. 201): Pennkey (e.g. bjbrown): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Introduction to Computer Programming Summer 2014 Midterm. Name:
CIS 110 Introduction to Computer Programming Summer 2014 Midterm Name: PennKey (e.g., bhusnur4): My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic
More informationCIS 110 Introduction to Computer Programming Summer 2017 Final. Recitation # (e.g., 201):
CIS 110 Introduction to Computer Programming Summer 2017 Final Name: Recitation # (e.g., 201): Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Fall 2016 Introduction to Computer Programming 13 Oct 2016 Midterm Exam
Name: CIS 110 Fall 2016 Introduction to Computer Programming 13 Oct 2016 Midterm Exam Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the University
More informationCIS 110 Introduction to Computer Programming Summer 2018 Midterm. Recitation ROOM :
CIS 110 Introduction to Computer Programming Summer 2018 Midterm Name: Recitation ROOM : Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania s
More informationCIS 110 Introduction to Computer Programming Summer 2018 Final. Recitation # (e.g., 201):
CIS 110 Introduction to Computer Programming Summer 2018 Final Name: Recitation # (e.g., 201): Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 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 informationCIS Introduction to Computer Programming. 5 October 2012 Midterm
CIS 110-001 Introduction to Computer Programming 5 October 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 informationCIS 110 Fall 2015 Introduction to Computer Programming 7 Oct 2015 Makeup Midterm Exam
CIS 110 Fall 2015 Introduction to Computer Programming 7 Oct 2015 Makeup Midterm Exam Name: Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the
More informationCIS 110 Introduction to Computer Programming Summer 2014 Final. Name:
CIS 110 Introduction to Computer Programming Summer 2014 Final Name: PennKey (e.g., bhusnur4): My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity
More informationCIS 110 Introduction to Computer Programming Spring 2016 Final Exam
CIS 110 Introduction to Computer Programming Spring 2016 Final Exam Name: Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Introduction to Computer Programming Summer 2016 Final. Recitation # (e.g., 201):
CIS 110 Introduction to Computer Programming Summer 2016 Final Name: Recitation # (e.g., 201): Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 110 Introduction to Computer Programming Fall 2017 Midterm. Recitation ROOM :
CIS 110 Introduction to Computer Programming Fall 2017 Midterm Name: Recitation ROOM : Pennkey (e.g., paulmcb): DO NOT WRITE YOUR ID# ABOVE, YOU WILL LOSE A POINT My signature below certifies that I have
More informationCIS 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 informationCIS 110 Introduction to Computer Programming. 17 December 2012 Final Exam
CIS 110 Introduction to Computer Programming 17 December 2012 Final Exam Name: Recitation # (e.g. 201): Pennkey (e.g. bjbrown): My signature below certifies that I have complied with the University of
More informationCIS 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 informationCIS 110 Introduction to Computer Programming Summer 2016 Final. Recitation # (e.g., 201):
CIS 110 Introduction to Computer Programming Summer 2016 Final Name: Recitation # (e.g., 201): Pennkey (e.g., paulmcb): My signature below certifies that I have complied with the University of Pennsylvania
More informationCIS 371 Spring 2015 Computer Organization and Design 7 May 2015 Final Exam
CIS 371 Spring 2015 Computer Organization and Design 7 May 2015 Final Exam Name: Recitation # (e.g., 201): Pennkey (e.g., eeaton): My signature below certifies that I have complied with the University
More informationCIS 110 Introduction to Computer Programming Fall 2017 Final Midterm. Recitation Section# :
CIS 110 Introduction to Computer Programming Fall 2017 Final Midterm Name: Recitation Section# : Pennkey (e.g., paulmcb): DO NOT WRITE YOUR ID# ABOVE, YOU WILL LOSE A POINT My signature below certifies
More informationCIS 110 Introduction to Computer Programming Fall 2017 Final Midterm. Recitation Section# :
CIS 110 Introduction to Computer Programming Fall 2017 Final Midterm Name: Recitation Section# : Pennkey (e.g., paulmcb): DO NOT WRITE YOUR ID# ABOVE, YOU WILL LOSE A POINT My signature below certifies
More informationCIS 110 Spring 2014 Introduction to Computer Programming 12 May 2014 Final Exam Answer Key
CIS 110 Spring 2014 Final Exam 1 CIS 110 Spring 2014 Introduction to Computer Programming 12 May 2014 Final Exam Answer Key 0.) THE EASY ONE (1 point total) Check coversheet for name, recitation #, PennKey,
More informationPrelim 1. CS 2110, October 1, 2015, 5:30 PM Total Question Name True Short Testing Strings Recursion
Prelim 1 CS 2110, October 1, 2015, 5:30 PM 0 1 2 3 4 5 Total Question Name True Short Testing Strings Recursion False Answer Max 1 20 36 16 15 12 100 Score Grader The exam is closed book and closed notes.
More informationPrelim 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 informationPrelim 1. CS2110, October 2, 2014, 5:30 PM Extra Total Question TrueFalse Multiple Object Oriented
Prelim 1 CS2110, October 2, 2014, 5:30 PM 1 2 3 4 5 Extra Total Question TrueFalse Multiple Object Oriented Recursion Lists Extra Credit Max 20 20 30 15 15 5 100 Score Grader The exam is closed book and
More informationCsci 102: Sample Exam
Csci 102: Sample Exam Duration: 65 minutes Name: NetID: Student to your left: Student to your right: DO NOT OPEN THIS EXAM UNTIL INSTRUCTED Instructions: Write your full name and your NetID on the front
More informationCOS 126 General Computer Science Spring Written Exam 1
COS 126 General Computer Science Spring 2017 Written Exam 1 This exam has 9 questions (including question 0) worth a total of 70 points. You have 50 minutes. Write all answers inside the designated spaces.
More informationCS 314 Exam 2 Spring
Points off 1 2 3 4 5 Total off CS 314 Exam 2 Spring 2017 Your Name Your UTEID Instructions: 1. There are 5 questions on this test. 100 points available. Scores will be scaled to 200 points. 2. You have
More informationCIS 110 Introduction To Computer Programming. November 21st, 2011 Exam 2
CIS 110 Introduction To Computer Programming November 21st, 2011 Exam 2 Name and section # Pennkey (# and username): My signature below certifies that I have complied with the University of Pennsylvania
More informationData Structures and Algorithms Winter term 2016
Page 0 German University in Cairo December 26, 2016 Media Engineering and Technology Prof. Dr. Slim Abdennadher Dr. Wael Abouelsaadat Data Structures and Algorithms Winter term 2016 Final Exam Bar Code
More informationPrelim 2 Solution. CS 2110, April 26, 2016, 7:30 PM
Prelim Solution CS 110, April 6, 016, 7:0 PM 1 5 Total Question True/False Complexity Heaps Trees Graphs Max 10 0 0 0 0 100 Score Grader The exam is closed book and closed notes. Do not begin until instructed.
More informationCS 455 Final Exam Spring 2018 [Bono] May 8, 2018
Name: USC NetID (e.g., ttrojan): CS 455 Final Exam Spring 2018 [Bono] May 8, 2018 There are 9 problems on the exam, with 74 points total available. There are 12 pages to the exam (6 pages double-sided),
More informationCIS 110 Introduction to Computer Programming 20 December 2013 Final Exam. Answer Key
CIS 110 Introduction to Computer Programming 20 December 2013 Final Exam Answer Key 0.) THE EASY ONE: (1 point total) Check coversheet for name, recitation #, PennKey, and signature. 1.) MISCELLANEOUS
More informationYork University AS/AK/ITEC INTRODUCTION TO DATA STRUCTURES. Midterm Sample I. Examiner: S. Chen Duration: One Hour and 30 Minutes
York University AS/AK/ITEC 2620 3.0 INTRODUCTION TO DATA STRUCTURES Midterm Sample I Examiner: S. Chen Duration: One Hour and 30 Minutes This exam is closed textbook(s) and closed notes. Use of any electronic
More informationSEMESTER 1, 2011 EXAMINATIONS. CITS1200 Java Programming FAMILY NAME: GIVEN NAMES:
Computer Science & Software Engineering SEMESTER 1, 2011 EXAMINATIONS CITS1200 Java Programming FAMILY NAME: GIVEN NAMES: STUDENT ID: SIGNATURE: This Paper Contains: 26 pages (including title page) Time
More informationCIS 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 informationPrelim 2 Solution. CS 2110, April 26, 2016, 5:30 PM
Prelim Solution CS 110, April 6, 016, 5:0 PM 1 5 Total Question True/False Complexity Heaps Trees Graphs Max 10 0 0 0 0 100 Score Grader The exam is closed book and closed notes. Do not begin until instructed.
More informationComputer Science E-119 Fall Problem Set 1. Due before lecture on Wednesday, September 26
Due before lecture on Wednesday, September 26 Getting Started Before starting this assignment, make sure that you have completed Problem Set 0, which can be found on the assignments page of the course
More informationPrelim 2. CS 2110, April 26, 2016, 5:30 PM Total Question True/False Complexity Heaps Trees Graphs Max Score Grader
Prelim CS 110, April 6, 016, 5:0 PM 1 5 Total Question True/False Complexity Heaps Trees Graphs Max 10 0 0 0 0 100 Score Grader The exam is closed book and closed notes. Do not begin until instructed.
More informationCIS 110 Spring 2013 Make-Up Midterm, 13 February 2013, Answer Key. Miscellaneous
CIS 110 Make-Up 1 CIS 110 Spring 2013 Make-Up Midterm, 13 February 2013, Answer Key Miscellaneous 1. (1 points) (a) Write your name, recitation number, and PennKey (username) on the front of the exam.
More informationCIS 120 Midterm II November 16, Name (printed): Pennkey (login id):
CIS 120 Midterm II November 16, 2012 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 informationCS 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 informationCIS 110 Spring 2013 Final Exam, 29 April 2013, Answer Key. Miscellaneous
CIS 110 1 CIS 110 Spring 2013 Final Exam, 29 April 2013, Answer Key Miscellaneous 0. (1 points) (a) Write your name, recitation number, and PennKey (username) on the front of the exam. (b) Sign the certification
More informationCIS 110 Introduction To Computer Programming. October 5th, 2011 Exam 1. Review problems
CIS 110 Introduction To Computer Programming October 5th, 2011 Exam 1 Review problems Scores: 1 2 3 4 5 6 Total (100 max) CIS 110 Exam 1 Instructions You have 50 minutes to finish this exam. Time will
More informationCSC 207H Fall L Java Quiz Duration 25 minutes Aids allowed: none
CSC 207H Fall L0101 2011 Java Quiz Duration 25 minutes Aids allowed: none Last Name: Student Number: First Name: (Please fill out the identification section above and read the instructions below.) Good
More informationCS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016
Name: USC NetID (e.g., ttrojan): CS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016 There are 5 problems on the exam, with 56 points total available. There are 10 pages to the exam (5 pages
More informationCS171 Midterm Exam. October 29, Name:
CS171 Midterm Exam October 29, 2012 Name: You are to honor the Emory Honor Code. This is a closed-book and closed-notes exam. You have 50 minutes to complete this exam. Read each problem carefully, and
More informationExamination Questions Midterm 1
CS1102s Data Structures and Algorithms 10/2/2010 Examination Questions Midterm 1 This examination question booklet has 9 pages, including this cover page, and contains 15 questions. You have 40 minutes
More informationPRACTICE MIDTERM EXAM #2
This practice exam is based on the actual midterm exam from Cynthia s Spring 2014 class. It did not include a classes problem (which you should expect this quarter), and the memory/pointers problem covered
More informationSummer Final Exam Review Session August 5, 2009
15-111 Summer 2 2009 Final Exam Review Session August 5, 2009 Exam Notes The exam is from 10:30 to 1:30 PM in Wean Hall 5419A. The exam will be primarily conceptual. The major emphasis is on understanding
More informationPrelim 1, Solution. CS 2110, 13 March 2018, 7:30 PM Total Question Name Short answer
Prelim 1, Solution CS 2110, 13 March 2018, 7:30 PM 1 2 3 4 5 6 Total Question Name Short answer Exception handling Recursion OO Loop invariants Max 1 30 11 14 30 14 100 Score Grader The exam is closed
More informationCIS 110 Introduction to Computer Programming. 12 February 2013 Midterm. Answer Key
CIS 110 Introduction to Computer Programming 12 February 2013 Midterm Answer Key 0. (1 point) Miscellaneous (a) Write your name, recitation number, and PennKey (username) on the front of the exam. (b)
More informationChapter 7 User-Defined Methods. Chapter Objectives
Chapter 7 User-Defined Methods Chapter Objectives Understand how methods are used in Java programming Learn about standard (predefined) methods and discover how to use them in a program Learn about user-defined
More informationReview Chapter 6 in Bravaco. Short Answers 1. This type of method does not return a value. a. null b. void c. empty d. anonymous
Assignment 3 Methods Review CSC 123 Fall 2018 Notes: All homework must be submitted via e-mail. All parts of assignment must be submitted in a single e-mail with multiple attachments when required. Notes:
More informationCS100J November 20, 2001
CS100J November 20, 2001 Prelim 3 Solutions 7:30 PM 9:00 PM (Print last name, first name, middle initial/name) (Student ID) Statement of integrity: I did not, and will not, break the rules of academic
More informationPrelim 2. CS 2110, November 20, 2014, 7:30 PM Extra Total Question True/False Short Answer
Prelim 2 CS 2110, November 20, 2014, 7:30 PM 1 2 3 4 5 Extra Total Question True/False Short Answer Complexity Induction Trees Graphs Extra Credit Max 20 10 15 25 30 5 100 Score Grader The exam is closed
More informationCIS Fall 2012 Midterm, 7 June 2012, Answer Key. Miscellaneous
CIS 110-001 1 CIS 110-001 Fall 2012 Midterm, 7 June 2012, Answer Key Miscellaneous 1. (1 points) (a) Write your name, recitation number, and PennKey (username) on the front of the exam. (b) Sign the certification
More informationSECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017
SECONDARY SCHOOL, L-IMRIEĦEL HALF YEARLY EXAMINATIONS 2016/2017 YEAR: 10 Computing Time: 1½ Hr. Name: Class: Instructions: 1. Answer all the questions in the space provided on this paper. 2. Calculators
More informationName: Pennkey (eg, sweirich): CIS 120 Final Exam May 8, 2012
Name: Pennkey (eg, sweirich): CIS 120 Final Exam May 8, 2012 My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity in completing this examination.
More informationCSE 131 Introduction to Computer Science Fall Exam II
CSE 131 Introduction to Computer Science Fall 2013 Given: 6 November 2013 Exam II Due: End of session This exam is closed-book, closed-notes, no electronic devices allowed. The exception is the cheat sheet
More informationAbout this exam review
Final Exam Review About this exam review I ve prepared an outline of the material covered in class May not be totally complete! Exam may ask about things that were covered in class but not in this review
More informationPrelim 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 information17 February Given an algorithm, compute its running time in terms of O, Ω, and Θ (if any). Usually the big-oh running time is enough.
Midterm Review CSE 2011 Winter 2011 17 February 2011 1 Algorithm Analysis Given an algorithm, compute its running time in terms of O, Ω, and Θ (if any). Usually the big-oh running time is enough. Given
More informationCOS 126 Written Exam 2, Fall 2009
NAME: COS 126 Written Exam 2, Fall 2009 login ID: precept: This test is 11 questions, weighted as indicated. The exam is closed book, except that you are allowed to use a one page cheatsheet. No calculators
More informationCS 314 Final Fall 2011
Points off 1 2A 2B 2C 3 4 5 Total off Net Score CS 314 Final Fall 2011 Your Name_ Your UTEID Instructions: 1. There are 5 questions on this test. 2. You have 3 hours to complete the test. 3. You may not
More informationCIS 110 Introduction To Computer Programming. October 5th, 2011 Exam 1. Answer key for review problems
CIS 110 Introduction To Computer Programming October 5th, 2011 Exam 1 Answer key for review problems Scores: 1 2 3 4 5 6 Total (100 max) CIS 110 Exam 1 Instructions You have 50 minutes to finish this exam.
More informationNAME: c. (true or false) The median is always stored at the root of a binary search tree.
EE 322C Spring 2009 (Chase) Exam 2: READ THIS FIRST. Please use the back side of each page for scratch paper. For some of the questions you may need to think quite a bit before you write down an answer.
More informationMidterm Exam (REGULAR SECTION)
Data Structures (CS 102), Professor Yap Fall 2014 Midterm Exam (REGULAR SECTION) October 28, 2014 Midterm Exam Instructions MY NAME:... MY NYU ID:... MY EMAIL:... Please read carefully: 0. Do all questions.
More informationLINKED LISTS cs2420 Introduction to Algorithms and Data Structures Spring 2015
LINKED LISTS cs2420 Introduction to Algorithms and Data Structures Spring 2015 1 administrivia 2 -assignment 5 due tonight at midnight -assignment 6 is out -YOU WILL BE SWITCHING PARTNERS! 3 assignment
More information1.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 informationIntroduction to Computer Science II CS S-20 Linked Lists III
Introduction to Computer Science II CS112-2012S-20 Linked Lists III David Galles Department of Computer Science University of San Francisco 20-0: Linked List Previous Practical Example: removeat(int index)
More informationCS 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 informationPrelim 1. CS 2110, 13 March 2018, 7:30 PM Total Question Name Short answer
Prelim 1 CS 2110, 13 March 2018, 7:30 PM 1 2 3 4 5 6 Total Question Name Short answer Exception handling Recursion OO Loop invariants Max 1 30 11 14 30 14 100 Score Grader The exam is closed book and closed
More informationPrelim 1. CS 2110, March 15, 2016, 7:30 PM Total Question Name True False. Short Answer
Prelim 1 CS 2110, March 15, 2016, 7: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 informationReview Questions for Final Exam
CS 102 / ECE 206 Spring 11 Review Questions for Final Exam The following review questions are similar to the kinds of questions you will be expected to answer on the Final Exam, which will cover LCR, chs.
More informationFinal exam. CS 2110, December 15, 2016, 9:00AM
Final exam CS 2110, December 15, 2016, 9:00AM Question Short Trie Loop Exp Rec Gen Span Mon BigO Data Total Max 20 7 9 10 9 9 8 10 10 8 100 Score Grader The exam is closed book and closed notes. Do not
More information1.00/1.001 Introduction to Computers and Engineering Problem Solving. Final Exam
1.00/1.001 Introduction to Computers and Engineering Problem Solving Final Exam Name: Email Address: TA: Section: You have three hours to complete this exam. For coding questions, you do not need to include
More informationCSCI 102L - Data Structures Midterm Exam #2 Spring 2011
CSCI 102L - Data Structures Midterm Exam #2 Spring 2011 (12:30pm - 1:50pm, Thursday, March 24) Instructor: Bill Cheng ( This exam is closed book, closed notes, closed everything. No cheat sheet allowed.
More informationCS5000: Foundations of Programming. Mingon Kang, PhD Computer Science, Kennesaw State University
CS5000: Foundations of Programming Mingon Kang, PhD Computer Science, Kennesaw State University OOP Three main programming mechanisms that constitute object-oriented programming (OOP) Encapsulation Inheritance
More informationUNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division. P. N. Hilfinger.
UNIVERSITY OF CALIFORNIA Department of Electrical Engineering and Computer Sciences Computer Science Division CS61B Fall 2015 P. N. Hilfinger Test #1 READ THIS PAGE FIRST. Please do not discuss this exam
More informationFinal Exam CS 251, Intermediate Programming December 13, 2017
Final Exam CS 251, Intermediate Programming December 13, 2017 Name: NetID: Answer all questions in the space provided. Write clearly and legibly, you will not get credit for illegible or incomprehensible
More informationExam Percentage: / 55 = %
1/6 CS 1316 - Exam 1 - Spring 2010 Name: CS 1316 - Exam 1 - Spring 2010 Your Grading TA: Your Section : INTEGRITY: By taking this exam, you pledge that this is your work and you have neither given nor
More informationCIS 120 Midterm I October 2, Name (printed): Username (login id):
CIS 120 Midterm I October 2, 2015 Name (printed): Username (login id): My signature below certifies that I have complied with the University of Pennsylvania s Code of Academic Integrity in completing this
More informationCS 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 informationInstructions. Definitions. Name: CMSC 341 Fall Question Points I. /12 II. /30 III. /10 IV. /12 V. /12 VI. /12 VII.
CMSC 341 Fall 2013 Data Structures Final Exam B Name: Question Points I. /12 II. /30 III. /10 IV. /12 V. /12 VI. /12 VII. /12 TOTAL: /100 Instructions 1. This is a closed-book, closed-notes exam. 2. You
More informationCMSC 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 informationPrelim 1. CS 2110, 13 March 2018, 5:30 PM Total Question Name Short answer
Prelim 1 CS 2110, 13 March 2018, 5:30 PM 1 2 3 4 5 6 Total Question Name Short answer Exception handling Recursion OO Loop invariants Max 1 30 11 14 30 14 100 Score Grader The exam is closed book and closed
More informationMARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012
MARKING KEY The University of British Columbia MARKING KEY Computer Science 260 Midterm #2 Examination 12:30 noon, Thursday, March 15, 2012 Instructor: K. S. Booth Time: 70 minutes (one hour ten minutes)
More informationCSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators)
Name: Email address: Quiz Section: CSE 332 Spring 2013: Midterm Exam (closed book, closed notes, no calculators) Instructions: Read the directions for each question carefully before answering. We will
More informationCSE wi Midterm Exam 2/8/18. Name UW ID #
Name UW ID # There are 11 questions worth a total of 120 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,
More informationCSE 250 Final Exam. Fall 2013 Time: 3 hours. Dec 11, No electronic devices of any kind. You can open your textbook and notes
CSE 250 Final Exam Fall 2013 Time: 3 hours. Dec 11, 2013 Total points: 100 14 pages Please use the space provided for each question, and the back of the page if you need to. Please do not use any extra
More informationCSE 143 Final Exam Part 1 - August 18, 2011, 9:40 am
CSE 143 Final Exam Part 1 - August 18, 2011, 9:40 am Name Student ID # Section TA Name The exam is closed book, closed notes, closed devices, except that you may have a 5x8 card with handwritten notes
More informationCS150 Sample Final. Name: Section: A / B
CS150 Sample Final Name: Section: A / B Date: Start time: End time: Honor Code: Signature: This exam is closed book, closed notes, closed computer, closed calculator, etc. You may only use (1) the final
More informationPoints off Total off Net Score. CS 314 Final Exam Fall 2016
Points off 1 2 3 4 5 6 Total off Net Score CS 314 Final Exam Fall 2016 Your Name Your UTEID Instructions: 1. There are 6 questions on this test. 100 points available. Scores will be scaled to 300 points.
More information