5.
Inheritance the is-a relationship is implemented through simple association.
Option b
6.
'Don't expose member data in public" is a design guideline.
False
It is possible to expose member data in public is a design guideline.
The following True/False type question relate to Class Design Guidelines. Question 5 ociation The is a...
Question 1 10 pts Inheritance is a capability of C++ to represent increased specialization that is often found in real world relationships. True False Question 2 10 pts Inheritance between a child and parent object exhibits an 'relationship. Question 3 10 pts As you move down an inheritance relationship from parent to child, you typically move from a general to specific description. True False Question 4 10 pts The syntax for declaring DerivedClass to publicly inherit from BaseClass is given...
Y. Daniel Liang’s 8 Class Design Guidelines were posted on the File Manager and handed out in class. Please choose 5 guidelines and discuss them in depth. For each guideline, use 1 page or more for your discussion. You can use the code provided in class to demonstrate your points. The code should not be more than one-third of your writing. 1. Cohesion • [✓] A class should describe a single entity, and all the class operations should logically fit...
Question 1 2 pts The preprocessor executes after the compiler. False True Question 2 2 pts What code is human-readable and follows the standards of a programming language? Secret code Source code Key code None of these Machine code Question 3 2 pts What is the symbol that marks the beginning of a one line comment? Question 1 2 pts The preprocessor executes after the compiler. True False Question 5 2 pts A statement that may be used to stop...
Design a class Complex for handling Complex numbers and include the following: _ real: a double _ imaginary: a double The class has the following member functions. a. A constructor initializing the number with default parameters. b. Getters and Setters of the class data members as given below _ void setReal(double r) _ double getReal()const _ void setImaginary(double i) _ double getImaginary() const d. Overload unary ! operator which returns true if the real and the imaginary parts are zero,...
QUESTION 1 Each class must be declared in its own .java file True or False? QUESTION 2 The keyword this must always be explicitly used when referring to an object's instance variables and methods from within one of its non-static methods. True or False? QUESTION 3 When used in a class' main method the this keyword references the object representing the class itself. True or False? QUESTION 4 Accessor methods that test whether a condition is true or false are...
QUESTION 15 What is the __str__ method used for? a. It is used to determine if a class attribute is a string. b. It is used to initiate string values during instantiation. c. It builds and returns a string representation of an object's state. d. It converts a string attribute within a class. 1 points QUESTION 16 What method is known as a class's constructor, because it is run automatically when a user instantiates the class? a. __start__ b....
Question 16 You must put your data in classes if you use C++. True False 2 points Question 17 Constructors are automatically invoked during class instantiation. True False 2 points Question 18 To make your data accessible to entities outside of your class, declare the members of that class as private. True False 2 points Question 19 You can make arrays of built-in types like int and double, but not of user-defined types. True False 2 points Question 20 One...
C++ PROGRAMMING QUESTION: MULTIPLE/ TRUE OR FALSE
In C++, programmers can use a class to create a large number of variables of that type. 2.Every object shares just a single copy of the member variable's defined by its class. 3.The mutator ("setter") methods of a class are typically marked with the const modifier. 4.The accessor ("getter") methods of a class are typically marked with the const modifier.
Question 60.1 pts Which of the following is true about a concrete class? A concrete class may be extended. A concrete class may be instantiated. A concrete may NOT contain abstract methods. All of the above. None of the above. Flag this Question Question 70.1 pts Which of the following is true? A class extends exactly one other class and may implement any number of interfaces. A class may extend at most one concrete class, may extend any number of...
Question 2 Answer the questions (i) to (iv) based on the following: class PRODUCT { int Code: char Item[20]; protected: float Qty; public: PRODUCT ( ); void GetIn( ); void Show( ): }; class WHOLESALER { int WCode; protected: char Manager[20]; public: WHOLESALER(); void Enter(); void Display (); }; class SHOWROOM : public PRODUCT, private WHOLESALER { char Name[20],City[20]; public: SHOWROOM(); void Input (); void View ( ); }; (i) Which type of Inheritance out of the following is illustrated...