Solve the following parts: Part A The following Unified Modeling Language diagra
ID: 3573384 • Letter: S
Question
Solve the following parts:
Part A
The following Unified Modeling Language diagram represents an object called Foo. Give the name of all private data members and private member functions for the object Foo.
Part B:
Explain in your own words what value is stored in variable temp below.
vector X;
vector : : iterator point;
double temp = 1.0;
// ... after X is initialized ...
if ( X.size() > 0 )
for ( point = X.begin(); point != X.end(); point++)
temp *= *point;
Part C
Give the name of the C++ keyword that provides support for combining data attributes and member functions in one construction.
The following Unified Modeling Language diagram represents an object called Foo. Give the name of all private data members and private member functions for the object Foo. Be sure to strike the Enter key before you click on the Save button. Foo a: int +b double +Foo +c char d bool Foo dExplanation / Answer
Part A)
a
d()
- sign is used to denote private access specifier.
Part B)
temp will containt all the values of X vector multiplied in between. For example if X contains [3.0, 2.0, 0.5] then temp = temp * 3.0; // 1.0 * 3.0 = 3.0
temp = temp * 2.0; //3.0 * 2.0 = 6.0
temp = temp * 0.5; //6.0 * 0.5 = 3.0
We loop through each vector element using iterator and multiply it by temp one by one;
Part C)
"class" provides support for combining data attributes and member functions in one construction. As you can see in above class diagram.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.