C++ (1) 1. (4 points) Briefly describe the slicing problem, and how to overcome
ID: 3918207 • Letter: C
Question
C++
(1)
1. (4 points) Briefly describe the slicing problem, and how to overcome it. 2. (15 points, 1 point each) True/False. Clearly circle either "TRUE" or "FALSE" for each ques- tion (a) When programming with exceptions, it is possible for an exception to be caught ina TRUE-FALSE different location than where it is actually thrown. (b) We have to place a catch block immediately after a try block. TRUE FALSE TRUE FALSE (d) From top to bottom, sequential catch blocks are generic and become more specific (c) A try block can only throw one exception. as you move down. TRUE FALSE (e) Derived classes are able to directly access private data members and functions of the base class. TRUE FALSE () An array variable can be initialized using a C-string after it has been declared. Example: char strl10]; tabc" TRUE FALSE (g) A string object can be initialized using a C-string after it has been declared. Example: string str; str"abc" TRUE-FALSEExplanation / Answer
Question a)
Answer: False
we can caught the exception if the other part of code is linked with it.
like class and object
Question b)
Answer: True
syntax: try{
}catch(exception e){
}
Question c)
Answer: TRUE
At one time try can throw only one exception
Question d)
Answer: True
Question e)
Answer: False
private data can be accessed by base class
Question f)
Answer: False
throws exception assignment to expression with array type.
Question g)
Answer: True
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.