Questions were created with C# in mind. 1. Indicate whether the following statem
ID: 3913559 • Letter: Q
Question
Questions were created with C# in mind.
1. Indicate whether the following statements are true or false. A. Code within a child constructor is executed before code in the parent constructor is executed. B. A major advantage of inheritance is that shared code can be implemented in the parent class while custom code is implemented in the child class C. Virtual data members and methods do not permit implementation in the base class. D. E. F. Abstract constructors can be overloaded in the base class. It is not possible to create an object of an abstract class. In a child class, while overriding a method, it is possible to override a public, protected, or private access specifier. For example, you can change a method that is protected in the parent to become public in the child Abstract methods and properties may be implemented in the class where they are declared H. An abstract class may contain an implementation of a property or method 2. Modify the current base class constructor inside Example 9-2 by adding a third string parameter called sector. Then, create a new property called Sector in the base class to store the sector data when the base constructor is called. Next, modify both constructors in the Charity class to also receive a sector parameter. After making these changes, adjust your code as required to enable object creation with the following instructions: Charity unicef charity unitedway = new charity ("United Way", TAX CODE , "Community Support"); Finally, change the ShowOrganizationlnfo() method so the final output after all changes resembles the following: = new charity ("Unicef", "Child Advocacy") ; * Base constructor * * Child Constructor A* Organization Name: Unicef Sector Child Advocacy Tax code: UnassignedExplanation / Answer
If you post more than 1 question, as per chegg guidelines I have to solve only first question. Also if you post more than 4 parts in a question, as per chegg guidelines I have to solve only first 4 parts.
Ques 1.
(a) False
The parent constructor is always executed first and then the parent class constructor. It is how the compiler isdesigned to work.
(b) True
In inheritance, we can inherit the class and use its code without explicitly writing the same code again and again. In this way, the length of the code is small and no extra work is needed to be done and it saves time and effort. This is the major advantage of inheritance.
(c) False
We can implement the virtual method in the base class.
(d) True
We can overload the abstract constructor in the base class.
(e) True
Abstract class is a class which can't be instantiated. Which means we can't create an object of an abstract class. If we do so, it qill show a compile time error.
(f) False
We may be able to so so with the public and protected specifier. But we can't do that with the private specifier. It will just call the function in the super class.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.