Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You will write a function called as character_finder which will find the number of existence of as specific character in a text file. The function

image text in transcribed

You will write a function called as "character_finder" which will find the number of existence of as specific character in a text file. The function will take two input arguments; i) "fileName" as the char vector of the filename and ii) the character" as the specific character that will be counted. The returning argument will be called as numberOfChar", the number of characters that are found. If the input argument "character is not a valid char or if the file does not exist in the working directory, the function will return -1. The test file that can be used to test your code is attached to this question with the name of "test_file.txt". Please test your code with that file and compare your results with the below test cases. Example usages of the function is given below; Please upload your written function as a m.file (if.m file type is not supported, please upload your function as a txt file) >> charnum = character_finder('test_file.txt', 't') charnum - 39 >> charnum = character_finder('test_file.txt', 'E') charnum = >> charnum = character_finder('test_file.txt', 'T') charnum - >> charnum = character_finder('test_file.txt','*') Windows Vs charnum

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

MySQL Crash Course A Hands On Introduction To Database Development

Authors: Rick Silva

1st Edition

1718503008, 978-1718503007

More Books

Students also viewed these Databases questions

Question

What should Sheila have done to avoid interviews like this one?

Answered: 1 week ago

Question

How would you assess the value of an approach like this?

Answered: 1 week ago

Question

When would you use one approach, and when would you use another?

Answered: 1 week ago

Question

3. How would this philosophy fit in your organization?

Answered: 1 week ago