Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The file, Sales.txt , shown in Figure 1 contains the product# and four quarterly sales for several products. Figure 1 : Sales.txt 1 0 3
The file, Sales.txt shown in Figure contains the product# and four quarterly sales for several products.
Figure : Sales.txt
The following code is intended to read the product# and quarterly sales from each row in Sales.txt file and store them in a dimenstiona array named sales:
string sales new string; Declare a D array
private void TwoDimArrayLoadobject sender EventArgs e
string currentLine;
string fields;
int row ;
StreamReader SalesReader new StreamReaderSalestxt;
while SalesReaderEndOfStream false
currentLine SalesReader.ReadLine;
fields currentLine.Split;
for int column ; column ; column
XXXXX; missing statement
row row ;
In the above code, XXXXX represents the missing statement that stores the data in sales array. The appropriate statement to store the data in sales array is:
Question options:
a
sales column fieldscolumn;
b
salesrow column fieldsrow;
c
salesrow fieldscolumn;
d
salesrow column fieldscolumn;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started