Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write the code in C#, Visual Studio 1) Create a method: void countHowMany(string str, out int aCount, out int bLastLine, out int aFirstLine). The function

image text in transcribed

write the code in C#, Visual Studio 1) Create a method: void countHowMany(string str, out int aCount, out int bLastLine, out int aFirstLine). The function returns in the out parameter aCount the number of times the string str was found in a file named "Clex8.txt" 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 a 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions

Question

How could assessment be used in an employee development program?

Answered: 1 week ago