Hello! This is C++. Could you plaease answer these questions? Thank you and have
ID: 3712316 • Letter: H
Question
Hello! This is C++.
Could you plaease answer these questions?
Thank you and have a good one!
1. You can use the address operator (____) to examine the memory address of a variable.
%
$
*
&
2. Object-oriented programs use ____ to carry out the same operation in a manner customized to the object.
inheritance
is-a relationships
polymorphism
methods
3. If you create a firstName string and initialize it to "Mary", and then use the C++ statement cout << firstName.substring(1,2);, the output is ____.
Mary
ar
Ma
empty because the program does not compile
4. When you create a class, you usually make the functions private.
True
False
5. In object-oriented programming, descendent classes can ____ all the attributes of the original (or parent) class, or they can override inappropriate attributes.
extend
inherit
implement
adopt
%
$
*
&
Explanation / Answer
1.
&
operator is used to return the memory address of a variable.
2.
polymorphism
Object oriented programs use polymorphism to carry out the same operation in a manner customized to the object.
3.
error
Because it is substr() method not the substring() method.
4.
True
Only we declare public when other objects or classes to access the function. Other wise make it private.
5.
inherit
In object-oriented programming, descendent classes can inherit all the attributes of the original (or parent) class, or they can override inappropriate attributes.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.