Question: write the code in C#. Visual Studio 1) Create a method: void countHowMany(string str, out int aCount, out int bLastLine, out int a The function
write the code in C#. Visual Studio
1) Create a method: void countHowMany(string str, out int aCount, out int bLastLine, out int a The function returns in the out parameter aCount the number of times the string str was found in a file named "Clex8.txt"; it returns in bLastLine the number of the last line in which str was found (or -1 if str is not found in the file); it returns in bFirstLine the number of the first line in which str was found (or -1 if str is not found in the file). For example, if the file contains the following lines: BAA CAA BAA BAA And there is function call: countHowMany("BAA,out count, out last, out first) Then after the call completes count would be 3 (since BAA appears 3 times in the file), last would be 5 (since the last line in which BAA appears is line number 5), and first would be 2 (since the first line in which BAA appears is 2). If there is a function call: countHowMany(TRY",out count, out last, out first) Then after the call completes count would be 0, last would be -1, and first would be -1 (since "TRY" does not appear in the file)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
