Spring 201s cosCi13.101 Test 2: 4/3/2018 19. In C++, t: is the operator notation
ID: 3699700 • Letter: S
Question
Spring 201s cosCi13.101 Test 2: 4/3/2018 19. In C++, t: is the operator notation known as thenotation. only accesses the value(s) of the data member(s) and returns it is scope resolution c.access specifying d.dereferencing 20. A class and its members can be described graphically using a d. ??? a. OON 21. A member function of a class that .OOD f called an) function. b. mutator d. destructor e, constructor 22. How many destructors can a class have? a no explicit destructors are allowed for most classes b. one c. two d. any number 23. What is the return type of a constructor? b. any integral type d. any type e.none a. void 24. Which of the following is true about classes and structs? a. By default (without specifier), members of a stru b. A struct variable is passed by value only, and a class variable is passed by reference only c. An assignment operator is allowed on class variables, but not on struct variables. d. You cannot use the member access specifier private in a struct. ct are public and members of a class are private. 25. With functions, the definitions of the member functions are placed in the header file. 26. A program or software that uses and manipulates the objects of a class is called a(n) of that class. b. user function of a class changes the values of the member variable(s) of the class. c. client d. instance a. server 27. A(n) 28. The header file of a class is also known as the file. a. implementationb. client 29. A class can have more than one constructor 30. If a class has no constructor(s).C++ provides the default constructor. c. library d. specification (True/ Fals (True Fal 31. Complete the following code of a function, diagSum) that returns the sum of all diagonal elemert a two-dimensional int square array? For instance, ifSZE s14 2 0 ,then it should return 11 which is 2 + 2 + 7. Assume that SIZE is a global constant variable declared at the beginning. [10 points = 3 and the array: int diagSum( int sum 0; for return sumExplanation / Answer
19) Scope resolution
because :: is scope resolution operator in c++
20)UML
because UML can be used for modeling a system independent of a platform language.
21)accessor
because it returns the value of the private member variable which can be done only by the member function of a class.Only member function can access private member variable.
22)one
A destructor doesn't have parameters, so there can be only one.
23)none
because when we call a constructor it creates a temporary object of Constructor.
24) By default struct members are public and class members are private.
25)inline function can be used
26)Client - program or software that uses and manipulates the objects of a class
27)Mutator functions - member functions that change the value of member variables in a class.
28)implementation
because implementation file is often used to contain the implementation code for the method(s) of a class.
29)True
30)True
31)
int digitSum(int a[][],int size)
{
int sum=0;
for(int i=0;i<size;i++)
{
sum = sum + a[i][i];
}
return sum;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.