double salesData[1000]; Unified Modeling Language (UML) notation. a flowchart. U
ID: 3764974 • Letter: D
Question
double salesData[1000];
Unified Modeling Language (UML) notation.
a flowchart.
Unified Abstract Language (UAL) notation.
Unified Encapsulation Language (UEL) notation.
define
ifndef
ifdef
endif
classname.hdr
classname.h
classname.def
classname.cpp
1. (TCO 1) Explain how to use loops to process data stored in a two-dimensional array. In your explanation include a two-dimensional array declaration and initialization.(Points : 10)
Question 2.2. (TCO 1) Given a two-dimensional array declaration, describe two different methods on how the all the array elements could be initialized. For example, write the declaration for a two-dimensional array of type integer and set all elements of the array equal to a value of 0. (Points : 10)
Question 3.3. (TCO 2) Explain how encapsulation and data hiding are incorporated in C++ classes. Why are these concepts important in object-oriented programming? (Points : 10)
Question 4.4. (TCO 2) Explain the difference between a parameterized constructor and a default constructor. Provide an example class that includes both types of constructors. (Points : 10)
Question 5.5. (TCO 3) Assume that a definition of class Automobile has two composite objects called myEngine of class Engine and myTransmission of class Transmission. If an object of Automobile is instantiated and then goes out of scope, list the sequence in which all constructors and destructors are called. Also, provide the explanation for why they are called in this sequence. (Points : 10)
Question 6.6. (TCO 4) Explain how access privileges affect members of the derived class and the objects created from them. (Points : 10)
Question 7.7. (TCO 4) If a class is derived public from a base class, explain how this affects the inheritance of all public, protected, and private members of the base class by the derived class. (Points : 10)
Question 8.8. (TCO 8) Describe what a namespace is and provide general syntax of a namespace statement. (Points : 10)
1. (TCO 1) Assume you have the following declaration:double salesData[1000];
Which of the following ranges is valid for the index of the array salesData? (Points : 4) 0 through 9990 through 1000
1 through 1001
1 through 1000
Explanation / Answer
Question 1.)
0 through 999 is the answer. Array index starts with 0
Question 2.2)
alpha = {8, 6, 10, 8, 9}
Question 3.3)
for (j = 0; j <=50; j++)
array of size 50, so index starts from 0 to 49
Question 4.4)
Both are true
Question 5.5)
mystery(alpha, 50);
Question 6.6)
0 1
1 2
2 3
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.