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; 1) "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" 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', '') charnum 39 >> charnum = character_finder('test_file.txt", "E") charnum - >> charnum = character_finder('test_file.txt", ") charnum= >> charnum - character_finder('test_file.txt','*) charnum= 0

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

Databases Illuminated

Authors: Catherine Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions

Question

5. Discuss the role of the Web in career management.

Answered: 1 week ago