Question

In: Computer Science

true or false C++ a.    (T or F)   A function or method cannot return a value of type...

true or false C++

a.    (T or F)   A function or method cannot return a value of type array.

b.    (T or F)   C++ throws an exception if you try to refer to element 47 in an array with 20 elements.

c.    (T or F)   I can copy one array to another by simply using an assignment statement which assigns the one array to the other.

d.    (T or F)  An exception is the occurrence of an erroneous or unexpected situation during the execution of a program.

e.    (T or F)  The try / catch structure is used to test for and catch occurrences of syntax errors.

Solutions

Expert Solution

Ans a) True

C++ does not provide us the functionality to return a value of type array. However, if we want to return an array we can use a pointer and return the first element of the array. In this statement, we are asked to return the array itself, which is not possible in C++.

Ans b) False

C++ does not define the boundary checking. Hence, for the index greater than the size of the array it will return some arbitrary value.

Ans c) False

We can't copy the entire array to any second variable by using an assignment operator. We can use std::copy function to copy the array to any second variable.

Ans d) True

Exception always occurs during the execution of the program. It mostly arises due to the logical errors in the program. eg. Divide by Zero Exception.

Ans e) False

try / catch structure is used only for the exceptions or say logical error, like Divide by Zero Exception. If the program has the syntax errors, it will show those errors during the compile time itself. There is no need of try / catch structure for syntax errors.


Related Solutions

true or false C++ a.    (T or F)  A member of a class can be a method or...
true or false C++ a.    (T or F)  A member of a class can be a method or an attribute. b.    (T or F)The private attributes of a class cannot be accessed by the public methods of that class. c.    (T or F)  The initialization of a variable in the declaration Ex:  int counter = 0; is not allowed inside a class definition. d.    (T or F)  In C++ a class is a definition; it does not exist in RAM until an object is created, using the definition....
True/False Type T (for True) or F (for False) for each statement for both Discrete and...
True/False Type T (for True) or F (for False) for each statement for both Discrete and Continuous random variables. Question 19 The cdf F(x) is strictly increasing. Discrete: Continuous: Question 20 The cdf F(x) is between 0 and 1 (inclusive). Discrete: Continuous: Question 21 The limit as x → ∞ of F(x) is 1. Discrete: Continuous: Question 22 If x1 is the largest value in the range of X, then F(x1) = f(x1). Discrete: Continuous: Question 23 The pf/pdf f(x)...
True/False Type T (for True) or F (for False) for each statement for both Discrete and...
True/False Type T (for True) or F (for False) for each statement for both Discrete and Continuous random variables. X cannot map two sample points to the same number. Discrete: Continuous: The sample space (domain) must be discrete. Discrete: Continuous: The range of X is uncountably infinite. Discrete: Continuous: The cdf F(x) is differentiable everywhere. Discrete: Continuous: The limit as x → ∞ of F(x) is 1. Discrete: Continuous: The cdf F(x) is right-continuous. Discrete: Continuous: The pf/pdf f(x) is...
True/False Type T (for True) or F (for False) for each statement for both Discrete and...
True/False Type T (for True) or F (for False) for each statement for both Discrete and Continuous random variables. X cannot map the same sample point to two different numbers. Discrete: Continuous: The sample space (domain) can be either discrete or continuous. Discrete: Continuous: The range of X is countable. Discrete: Continuous: The area under the F(x) function is 1. Discrete: Continuous: The cdf F(x) is non-decreasing. Discrete: Continuous: The cdf F(x) is differentiable everywhere. Discrete: Continuous: The pf/pdf f(x)...
Type T (for True) or F (for False) for each statement for both Discrete and Continuous...
Type T (for True) or F (for False) for each statement for both Discrete and Continuous random variables. Question 16) X cannot map the same sample point to two different numbers. Discrete: Continuous: Question 17) The sample space (domain) must be discrete. Discrete: Continuous: Question 18 ) The range of X is uncountably infinite. Discrete: Continuous: Question 19) The area under the F(x) function is 1. Discrete: Continuous: Question 20) The cdf F(x) is differentiable everywhere. Discrete: Continuous: Question 21)...
True or False—Indicate if the statement is True (T) or False (F) for each of the...
True or False—Indicate if the statement is True (T) or False (F) for each of the following 10 statements: __________ 1. While variable costs are always relevant to a business decision, fixed costs are not, and need to be analyzed closely to determine if they will be different amongst the alternatives being considered. __________ 2. Facility level costs often include costs such as rent, property taxes, building maintenance, and utilities; facility level costs benefit the production process as a whole...
True or False (T/F) a. When the correlation coefficient of the two asset’s return is 1,...
True or False (T/F) a. When the correlation coefficient of the two asset’s return is 1, there is the greatest diversification benefit. ( ) b. If the NPV of a project is negative, the project should be accepted ( ). c. Increase in net working capital indicates cash inflow for a project ( ).
18H. TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false....
18H. TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 11. Production of traded goods falls in countries that export them. 12. International trade allows the world to use its resources more efficiently but one country’s gains are another country’s losses. 13. A country’s ability to produce a specific good with fewer resources than another country determines whether it has an absolute advantage in producing the good. 14. Comparative advantage is based on the...
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 1)...
TRUE/FALSE. Write 'T' if the statement is true and 'F' if the statement is false. 1) Accounting is an information system that identifies, measures, records and 1) communicates relevant information that objectively and correctly represents an organization's economic activities. 2) The main objective of accounting is to help people to invest in new products and 2) businesses. 3) A sole proprietorship is a business owned by one or more persons. 3) 4) Unlimited liability is an advantage for both a...
True/False Please write T if the statement is true or F if the statement is false:...
True/False Please write T if the statement is true or F if the statement is false: ____1. The contribution format income statement can be expressed in the following equation: Profit = (Sales – Variable expenses) – Fixed expenses.           ____2. The CM ratio can also be calculated by dividing the contribution margin per unit by the selling price per unit.      _____3.    Margin of safety in dollars = Total sales - Break-even sales        _____4.   The margin of safety cannot...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT