Exam 12: Object-Oriented Design
Exam 1: Introduction98 Questions
Exam 2: Using Objects76 Questions
Exam 3: Implementing Classes103 Questions
Exam 4: Fundamental Data Types125 Questions
Exam 5: Decisions120 Questions
Exam 6: Loops128 Questions
Exam 7: Arrays and Array Lists118 Questions
Exam 8: Designing Classes95 Questions
Exam 9: Inheritance101 Questions
Exam 10: Interfaces85 Questions
Exam 11: Inputoutput and Exception Handling109 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion110 Questions
Exam 14: Sorting and Searching109 Questions
Exam 15: The Java Collections Framework110 Questions
Exam 16: Basic Data Structures104 Questions
Exam 17: Tree Structures110 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Graphical User Interfaces76 Questions
Exam 20: Streams and Binary Inputoutput82 Questions
Exam 21: Multithreading82 Questions
Exam 22: Internet Networking74 Questions
Exam 23: Relational Databases75 Questions
Exam 24: XML74 Questions
Exam 25: Web Applications75 Questions
Select questions type
Suppose you are developing a payroll application that computes and displays weekly paycheck amounts for various employees. As a result of the design phase, the partial Employee class below is developed. Select the method header that best completes the class, according to the method comments. public class Employee
{
Private double hourlyRate;
Private int hoursWorked;
/**
Modifies the hourly rate for this employee.
@param newHourlyRate the rate per hour earned by the employee
*/
_________________________________________
{
// method body
}
}
(Multiple Choice)
4.7/5
(35)
Consider the following code snippet: public class Manager extends Employee
{
Private Project[] projects;
Private Address address;
) . .
}
Which of the following statements is NOT correct?
(Multiple Choice)
4.9/5
(33)
You are designing a software solution for a veterinary clinic. The clinic provides various services for each pet on each visit. You have decided that the following nouns apply to the requirements: Customer, Address, Pet, Visit, Visit Date, Service Charge, Total Charge, Next Appointment. Which of these should be represented as instance variables?
(Multiple Choice)
4.9/5
(31)
If many classes of a program depend on each other, we say that ____.
(Multiple Choice)
4.9/5
(32)
Consider the following code snippet: public class Purse
{
Private Coin[] coins;
) . .
}
Which of the following statements is correct?
(Multiple Choice)
4.9/5
(46)
You have determined a need for a Book class and a Page class in your program. Which relationship is most appropriate between these classes?
(Multiple Choice)
4.9/5
(35)
You have determined the need for a File class and a Folder class in your program. Which of the following would best describe the relationship between these classes?
(Multiple Choice)
4.8/5
(30)
Consider the following code snippet: public class Motorcycle
{
Private Tire[] tires;
) . .
}
Which of the following statements correctly describes the relationship between the Motorcycle and Tire classes?
(Multiple Choice)
4.8/5
(36)
You are designing an application to support a veterinary clinic. Which of the following probably should NOT be represented as an object?
(Multiple Choice)
4.7/5
(41)
Consider the following code snippet: public class Motorcycle
{
Private Tire[] tires;
) . .
}
This code is best described as an example of ____.
(Multiple Choice)
4.9/5
(40)
Under which of the following conditions would the public interface of a class be considered cohesive?
(Multiple Choice)
5.0/5
(37)
You are designing a software solution for an automobile rental company. A customer may rent only a single auto at a given time. You have decided that the following classes are needed: Auto, Customer, Address, Rental Contract. Which of these should be represented as aggregation?
(Multiple Choice)
4.9/5
(41)
Which of the following code snippets denotes that the Pen class depends on the Ink class?
(Multiple Choice)
4.9/5
(37)
Consider the following code snippet: public class Motorcycle extends Vehicle
{ ) . . }
Which of the following statements correctly describes the relationship between the Motorcycle and Vehicle classes?
(Multiple Choice)
4.8/5
(45)
Showing 21 - 40 of 104
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)