1. Which can declare and initialize an empty array of char type named c that will...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Which can declare and initialize an empty array of char type named "c" that will have up to 5 elements in C++? A. char[] c = new char(5); B. char c[5] = new char(); C. char c[5] = {}; D. char[] = {}; E. char[5] c = {}; 2. Given the following array, which represents 4? int n[] = {1, 2, 3, 4, 5 }; A. n[0] B. n[1] C. n[2] D. n[3] E. n[4] 3. Given the following array, what is the output? int n[] = { 1, 2, 3, 4, 5 }; cout << n[2] + n[3] << endl; A. 2+3 B. 5 C. 3+4 D. 7 E. n[2] + [3] 4. Given the following table that defines the values of elements of a two-dimensional array, which can return the value "Chem"? A. subject[1][1] B. subject[0][2] C. subject[2][2] D. subject[0][1] E. subject[1][0] element of array "subject" 0 Biol Math row\col 0 1 1 Musi Chem 2 Phys Mant 5. Given the following table that defines the values of elements of a two-dimensional array, which can declare and initialize the array? C++Proming A string subject]-new string[2][3 B. string subject[2][3]-(1: C. string[2][3] subject- (1: D. string subject[1][2]-{}: E. string[12] subject-1): row.col 0 6. In C++, what does a pointer object store? A. The value stored in a variable B. The data type of a variable. C. The memory address of a variable. D. The total bytes a variable occupies E. The identifier of a variable. 147 d-17.2561 pd dz A, null B. 43.21 C. 17.256 D. &d E, a value similar to 0061F75C B. 7 D. S E.4 7. Given the following code segment, what is the value of pd? double pd mullptri. double d 43.21 O Biol Math A.S B.4 C.3 D. 2 E. I 8. Given the following code segment, the output is 3 MINI 9. Given the following code segment, the output is int arr151 (5, 4, 3, 2, 1 12 int ptr sare[2] cout <<(ptr-1] << endl; 2 Phys Mant int arr110113, 8, 7, 6, 5, 4, 321-37 intp sarr121 cout ce pl] endi 10. Given three arrays, d1, 42, and d3, of double type in C++, which can use a pointer name "pet" to refer to a "jagged array" that uses these three arrays as element? A. double *pt-[&d1. &42&43); B. double "prt- & 41. 42.433; C. double() "pet-(41. 42. 43); D. double "prt (dt. d2. 43); E. double "prt[] [41, 42, 43); 1. Which can declare and initialize an empty array of char type named "c" that will have up to 5 elements in C++? A. char[] c = new char(5); B. char c[5] = new char(); C. char c[5] = {}; D. char[] = {}; E. char[5] c = {}; 2. Given the following array, which represents 4? int n[] = {1, 2, 3, 4, 5 }; A. n[0] B. n[1] C. n[2] D. n[3] E. n[4] 3. Given the following array, what is the output? int n[] = { 1, 2, 3, 4, 5 }; cout << n[2] + n[3] << endl; A. 2+3 B. 5 C. 3+4 D. 7 E. n[2] + [3] 4. Given the following table that defines the values of elements of a two-dimensional array, which can return the value "Chem"? A. subject[1][1] B. subject[0][2] C. subject[2][2] D. subject[0][1] E. subject[1][0] element of array "subject" 0 Biol Math row\col 0 1 1 Musi Chem 2 Phys Mant 5. Given the following table that defines the values of elements of a two-dimensional array, which can declare and initialize the array? C++Proming A string subject]-new string[2][3 B. string subject[2][3]-(1: C. string[2][3] subject- (1: D. string subject[1][2]-{}: E. string[12] subject-1): row.col 0 6. In C++, what does a pointer object store? A. The value stored in a variable B. The data type of a variable. C. The memory address of a variable. D. The total bytes a variable occupies E. The identifier of a variable. 147 d-17.2561 pd dz A, null B. 43.21 C. 17.256 D. &d E, a value similar to 0061F75C B. 7 D. S E.4 7. Given the following code segment, what is the value of pd? double pd mullptri. double d 43.21 O Biol Math A.S B.4 C.3 D. 2 E. I 8. Given the following code segment, the output is 3 MINI 9. Given the following code segment, the output is int arr151 (5, 4, 3, 2, 1 12 int ptr sare[2] cout <<(ptr-1] << endl; 2 Phys Mant int arr110113, 8, 7, 6, 5, 4, 321-37 intp sarr121 cout ce pl] endi 10. Given three arrays, d1, 42, and d3, of double type in C++, which can use a pointer name "pet" to refer to a "jagged array" that uses these three arrays as element? A. double *pt-[&d1. &42&43); B. double "prt- & 41. 42.433; C. double() "pet-(41. 42. 43); D. double "prt (dt. d2. 43); E. double "prt[] [41, 42, 43);
Expert Answer:
Answer rating: 100% (QA)
The detailed answer for the above question is provided below Answer 1 choic... View the full answer
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these programming questions
-
Compute the return on asset ratio for Year 2 given the following data: Total asset turnover ratio Net profit margin ratio Year 2 2.10 12.00% Year 1 1.90 10.00%
-
A complete binary tree of N elements uses array positions 1 to N. Suppose we try to use an array representation of a binary tree that is not complete. Determine how large the array must be for the...
-
A compare-exchange operation on two array elements A[i] and A[j], where i < j, has the form COMPARE-EXCHANGE (A, i, j) 1 If A[i] > A[j] 2 exchange A[i] with A[j] After the compare-exchange operation,...
-
Discuss the advantages or disadvantages of subsidiary legislations in the Malaysian legal system in dealing with Covid-19 vaccination. Please write down the legal terms for discussion. Please do not...
-
The chapter identifies seven economic, socio-historical, and institutional factors believed to influence accounting development. Explain how each one affects accounting practice.
-
What plate separation is required for a parallel plate capacitor to have a capacitance of 9.00 nF if the plate area is 0.425 m2?
-
What is not a proactive approach to forensic accounting a. Investigating complaints b. Effective internal controls c. Logging of exceptions d. Reviewing variances e. Financial audits
-
A six-column table for JKL Company follows. The first two columns contain the unadjusted trial balance for the company as of July 31, 2013. The last two columns contain the adjusted trial balance as...
-
QZ. Manuka International Co., is considering a development project that costs $3.8 million today and is expected to generate constant annual cash flow of $267,000 in perpetuity, with the first cash...
-
Walmart makes significant investments in operating capacity, primarily via investments in property, plant, and equipment, but also via investments in wholly and partially owned subsidiaries. Walmart...
-
Implement and verify a digital system which will enable a pulse the period (50us) of the clock signal to be selected every 5 clock periods (500us) or every 10 clock periods (1ms) depending on the...
-
During the last week of 2017, George Green, controller of We 'R' Appliances, received a memorandum from the firm's president, Jane Anderson. The memorandum stated that Anderson had negotiated a very...
-
Pick Corporation started business on January 1, 2019. The following information was compiled by Pick's accountant on December 31, 2019: Required a. You have been asked to assist the accountant for...
-
Match each of the items in the left column with the appropriate annual report component from the right column: 1. The company's total assets a. Income Statement 2. An opinion regarding whether the...
-
The text used Figure 6-3 to describe fluctuations in the spreads between riskless rate on 10-year US Treasury bonds and 10-year AAA and BBB corporate bonds. This figure can be updated by going to the...
-
The following are selected transactions of Fedor, Inc., during the month of January: 27 Lawrence Stores was granted a \(\$ 500\) allowance on goods shipped January 20. 29 Received from Lawrence...
-
Why should you include definitions in your answers, even if you are not asked to provide any? Select two options. It gets you additional marks. It shows the AP Reader that you memorized the work. It...
-
What is an insurable interest? Why is it important?
-
Can the master method be applied to the recurrence T (n) = 4T (n/2) + n 2 lg n? Why or why not? Give an asymptotic upper bound for this recurrence.
-
Prove that if a and b are any positive integers such that a | b, then (x mod b) mod a = x mod a for any x. Prove, under the same assumptions, that x = y (mod b) implies x = y (mod a) for any integers...
-
Use the following ideas to develop a nonrecursive, linear-time algorithm for the maximum-subarray problem. Start at the left end of the array, and progress toward the right, keeping track of the...
-
Compute the (1) current ratio and the (2) quick ratio for Nike, Inc. using the following excerpt from the balance sheet reported in a recent \(10-\mathrm{K}\) of Nike, Inc. At May 31 (in millions)...
-
Cash sales for Zeviae Inc. in 2020 were \(\$ 9\) million. The majority of sales were subject to a sales tax rate of \(6 \%\). Zeviae records sales taxes payable at the point of sale. Required a....
-
On September 1, 2020, Global Tech Inc. purchased merchandise for resale for \(\$ 8,000\) on credit terms \(2 / 15, \mathrm{n} / 60\) using the gross method and a perpetual inventory system. Global...
Study smarter with the SolutionInn App