Look at the following array definition. double sales[8][10]; A) How many rows does the array have? B) How many columns does the array have? C) How many elements does the array have? D) Write a statement that stores 3.52 in the last column of the last row in the array.
Added by Melissa N.
Step 1
B) The array has 10 columns, as indicated by the second dimension in the definition. C) The array has 8 rows * 10 columns = 80 elements. D) To store 3.52 in the last column of the last row, we can use the following statement: sales[7][9] = 3.52; Show more…
Show all steps
Your feedback will help us improve your experience
Gokul R Nair and 50 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
The matrix $\mathbf{A}$ in Example 2 shows the numbers of items sold, Find the matrix showing the number of units sold if a unit consists of (a) 5 items. (b) 10 items?
Linear Algebra: Matrices, Vectors, Determinants. Linear Systems
Matrices, Vectors: Addition and Scalar Multiplication
Choose the statement that does not apply to the following declaration: doubleƒ[ , ]ƒtotalCostOfItemsƒ=ƒ ƒƒƒƒ{{109.95,ƒ169.95,ƒ1.50,ƒ89.95}{27.9, 18.6, 26.8, 98.5}}; a. declares a two-dimensional array of floating-point values b. establishes the maximum number of rows as 4 c. sets the array element totalCostOfItems [0, 1] to 169.95 d. declares an area in memory where data of double type can be stored e. all are correct
Refer to the following matrices. A = [ 4 -6 7 -8 -12 5 2 3 2 0 9 4 8 4 7 -2 ] B = [ 2 -1 8 0 1 4 8 7 3 -2 0 2 ] C = [ 1 0 8 9 5 ] D = [ 1 3 -6 0 ] What is the size of each matrix?
Donna D.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD