Exam 7: Object-Oriented Design
Exam 1: Introduction64 Questions
Exam 2: Data and Expressions67 Questions
Exam 3: Using Classes and Objects49 Questions
Exam 4: Writing Classes53 Questions
Exam 5: Conditionals and Loops38 Questions
Exam 6: More Conditionals and Loops35 Questions
Exam 7: Object-Oriented Design44 Questions
Exam 8: Arrays45 Questions
Exam 9: Inheritance49 Questions
Exam 10: Polymorphism40 Questions
Exam 11: Exceptions39 Questions
Exam 12: Recursion55 Questions
Exam 13: Collections60 Questions
Select questions type
In which phase of program development would you expect the programmer(s) to create the pseudocode?
(Multiple Choice)
4.8/5
(35)
Interface classes cannot be extended but classes that implement interfaces can be extended.
(True/False)
4.8/5
(39)
Code Description Ch 07-1
Consider a class called ChessPiece. This class has two instance data, String type and int player. The variable type will store "King", "Queen", "Bishop", etc. and the int player will store 0 or 1 depending on whose piece it is. We wish to implement Comparable for the ChessPiece class. Assume that, the current ChessPiece is compared to a ChessPiece passed as a parameter.
Pieces are ordered as follows:
"Pawn" is a lesser piece to a "Knight"
a "Bishop" and "Knight" are equivalent for this example
both "Bishop" and "Knight" are lesser pieces to a "Rook"
a "Rook" is a lesser piece to a "Queen"
a "Queen" is a lesser piece to a "King".
-Refer to Code Description Ch 07-1: Write a static method that is passed two ChessPieces and determines if the two pieces are owned by the same player. It should return true or false.
(Essay)
4.9/5
(36)
Showing 41 - 44 of 44
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)