


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Quiz; Class: OBJECT-ORIENTED PROG I; Subject: Computer Science; University: University of Maryland; Term: Spring 2009;
Typology: Quizzes
1 / 4
This page cannot be seen from the preview
Don't miss anything!



Name (printed):
Student ID #:
Section # (or TA’s: name and time)
For both of the questions on the other side of this paper, assume the classes shown here:
public class Door { private int ht; private int rating;
public Door(int ht, int rating){ // valid constructor for the Door class } public Door(Door oldDoor){ // valid copy constructor for the Door class } public boolean equals(Door rtDoor){ // valid equals method for the Door class } //other methods appear here }
public class House { private Door[] all; private String address;
public House(Door[] doorList, String address){ //valid constructor for the House class } public House (House oldHouse){ //valid copy consructor for the House class } public boolean equals(House otherHouse){ //valid equals for the House class } //Other methods appear here }
Turn to the other paper to answer the questions. You may separate the two pages (it may be easier for you that way), but make sure you put your name on both and make sure you turn both back in at the end of the quiz.
This page intentionally blank.
import junit.framework.TestCase;
public class HouseTest extends TestCase {
public void testHouseHouse() { // Write the code that would need to be here to test // the copy constructor above. // Only one test is needed - not several as shown in class // or as you shouls have done on the project