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...
-
Consider a system that needs to store information about computers in a computer lab at a university, such as the features and location of each computer. What are the things that might be included in...
-
The following 2.5 m 8.1 m 6 m tank shown is filled by oil of SG = 0.88. Determine (a) The magnitude and the location of the line of action of the resultant force acting on surface AB (b) The...
-
Provide an example of a known liability, an estimated liability, and a contingent liability.
-
A small rural county has experienced unprecedented growth over the past 6 years, and as a result, the local school district built the new 500-student North Park Elementary School. The district has...
-
Friedrich Hayek, a proponent of classical liberal economic thought, wrote the following in his book The Road to Serfdom : It is important not to confuse opposition against...planning with a dogmatic...
-
On December 31, 2023, Stilton Service Companys year-end, the unadjusted trial balance included the following items: Required 1. Prepare the adjusting entry on the books of Stilton Service Company to...
-
Some of a portfolio consists of stock A, which has an expected return of 17.65% and a standard deviation of returns of 23.68%, and the rest of the portfolio consists of stock B, which has an expected...
-
Young is single and self-employed. His net profit from the business is $100,000. His SE tax on Schedule SE is $14,130. He contributed $6,000 to his self-employed SEP-IRA account. He also paid $7,800...
-
Dugar, A., Gujarathi, M. R. (2018). Toshiba's creative accounting for construction contracts. Issues in Accounting Education, 33 (3), 117-134 The FASB and the IASB have issued a joint standard on...
-
2. Why would investment companies go to the trouble of launching nanosatellites into space to improve their predictions? Why wouldn't they just rely on traditional sources of data to make these...
-
1. Define 'Systems' approach in communication skills. 2. What are all the different types of non-verbal communication forms available? 3. List down the key factors to be considered in gestures...
-
Assets Liabilities + Owners' Equity Cash $ 90,000 Liabilities $ 49,000 Noncash Assets 330,000 _________ Owners' Equity 420,000 Richard $ 157,000 Ruth 95,000 Riley 22,000 Robert 97,000 $ 420,000...
-
Answer the following programming Questions. Use the information given below. (a) List and briefly describe other ways in which the syntax and the interpretation of query languages may vary. (b)...
-
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...
-
Derive the orthogonality condition for the eigenfunctions of the beam shown in Figure 7.48. x L m, EA M Figure 7.48: Axially vibrating cantilever beam fixed at one end with a point-mass at the other...
-
Consider the longitudinally vibrating uniform beam shown in Figure 7.49. The ends of the beam are supported by linear springs with stiffnesses \(k_{1}\) and \(k_{2}\). Derive the frequency equation,...
-
The uniform shaft of Figure 7.51 is subjected to the torque \(T_{0} \sin \omega t\) at its free end. (a) Find the steadystate vibration response by solving the free vibration problem, including the...
Study smarter with the SolutionInn App