Get Solved Penn Foster 03683900
Get Solved Penn Foster 03683900
Exam: 036839RR – INHERITANCE AND EXCEPTION HANDLING
When you have completed your exam and reviewed your answers, click Submit Exam. Answers will not be recorded until you hit Submit Exam. If you need to exit before completing the exam, click Cancel Exam.
Questions 1 to 20: Select the best answer to each question. Note that a question and its answers may be split across a page break, so be sure that you have seen the entire question and all the answers before choosing an answer.
1. A basis for inheritance is the _______ class.
2. In inheritance, which of the following items is the largest?
3. Which of the following Exceptions indicates that an array with the wrong number of dimensions is being passed to a method?
4. If you need a public instance method for an Object class that gets a unique code for each object, which code should you use?
5. Two programmers are discussing derived class objects. Brianne says that you can assign a derived class object to an object of any of its superclass types. Jason says that an implicit conversion from one type to another is an automatic conversion. Who is correct?
A. Neither is correct.
B. Both Brianne and Jason are correct.
C. Only Jason is correct.
D. Only Brianne is correct.
6. Which of the following statements is not a benefit of using inheritance?
A. Inheritance makes the methods and data of subclasses available to the superclass.
B. Inheritance makes programs easier to understand.
C. Inheritance makes writing programs easier.
D. Inheritance makes methods and data available to existing classes.
7. According to the C# convention, which of the following examples is a correct exception error message?
A. Negative balance
B. Division by zero
C. The program attempted to divide by zero.
D. The bank balance is negative.
8. Of what is every subclass object an instance?
A. All the ancestors of the subclass
B. The specific subclass only
C. All the subclasses in the superclass
D. Both the subclass and superclass
9. Two programmers are discussing rethrowing an Exception. Jack says that when a method catches an Exception, you can rethrow it to a method that is called the method. Ashley says that within a catch block, you can rethrow a caught Exception by using the keyword throw with no object after it. Who is correct?
A. Neither Jack nor Ashley is correct.
B. Only Ashley is correct.
C. Both Jack and Ashley are correct.
D. Only Jack is correct.
10. Two programmers are discussing overriding base class methods. Marsha says that when you override a parent class method in a child class, the methods have the same name. Anna says that when you override a parent class method in a child class, the methods have the same parameter list. Who is correct?
A. Only Marsha is correct.
B. Neither Marsha nor Anna is correct.
C. Both Marsha and Anna are correct.
D. Only Anna is correct.
11. Which of the following statements is not an English-language example of polymorphism?
A. You play soccer differently than you play chess.
B. You run a marathon differently than you would run a track event.
C. You open a book differently than you open your eyes.
D. You exercise your right to vote differently than you exercise to lose weight.
12. If an Exception is thrown without a matching catch block, the program will
A. work as intended.
B. launch a try block.
13. Exceptions are usually not derived from
A. Exception classes
B. pre-defined Common Language Runtime exceptions derived from SystemException
C. System classes
D. user-defined application exception classes derived from ApplicationException
14. Classes that are prone to errors are said to be _______
15. Why are Exception classes typically named with the Exception as the second portion of their name?
A. It allows the compiler to recognize the subclass.
B. It makes Exception descendants easier to identify.
C. It allows the compiler to recognize the superclass.
D. It’s easier to locate in the code.
16. Which of the following phrases is another name for catch block?
A. catch report
B. catch code
C. catch point
D. catch clause
17. Suppose you’re creating a class diagram. Which of the following items would not be included in your code?
18. What happens when Exceptions are thrown?
A. They must be caught by the method that threw them.
B. They should be caught by the calling program.
C. They must be handled by the method that threw them.
D. They should be caught by the try-catch method.
19. Suppose you’re creating a derived class that inherits an abstract method from a parent. Which keyword should you use?
End of exam
20. Which of the following classes is extended when you create your Exception class?
Need Assistance with the Penn Foster?
Our online test-taking assistants are specialists who’re graduates of pinnacle universities with powerful subjective knowledge. Our professionals can take care of the troubles you’re dealing with on the subject of take my exam for me queries. Everything stages from easy topics to complex ones, we cowl they all beneath neath an unmarried platform. In case you’ve enrolled for a couple of problems with your online universities tests and also you do not have the time to cognizance on each of them concurrently then, you may sign up for our powerful nice of services, after which truly you may get favored assist withinside the shape of hiring for our professionals for doing my examination on-line for me at no hesitation.