Question 25 The statement cout << sales[0,3] + sales[1,3]; will __________. Use
ID: 3780910 • Letter: Q
Question
Question 25
The statement cout << sales[0,3] + sales[1,3]; will __________.
Use the following array named sales to answer this question.
10000
12000
900
500
20000
350
600
700
800
100
display 1300
display 1600
display sales [0,3] + sales[1,3]
result in an error
--------------------------------------------
Question 26
The statement sales[0,4] = sales[0,4 - 2]; will __________.
Use the following array named sales to answer this question.
10000
12000
900
500
20000
350
600
700
800
100
replace the 20000 amount with 900
replace the 20000 amount with 19998
replace the 20000 amount with 19100
result in an error
--------------------------------------------
Question 27
The statement sales[1,3] = sales[1,3] + 10; will __________.
Use the following array named sales to answer this question.
10000
12000
900
500
20000
350
600
700
800
100
replace the 900 amount with 910
replace the 500 amount with 510
replace the 700 amount with 710
replace the 800 amount with 810
10000
12000
900
500
20000
350
600
700
800
100
Explanation / Answer
Answer
25:
sales[0,3] = 500
sales[1,3] = 800
so sales[0,3] + sales[1,3] = 500 + 800 = 1300
so, answer is "display 1300"
26.
In sales[0,4 - 2], 4-2 is not allowed, i.e. operation on index inside [] is not allowed so,
answer is "result in an error"
27.
sales[1,3] = 800
so sales[1,3] = sales[1,3] + 10 => sales[1,3] = 800 + 10 => sales[1,3] = 810
answer is "replace the 800 amount with 810"
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.