Affordable College Homework

C program Files

1 min read

Assessment Brief

Develop the function char** indexedKeysAndOPerators(const char * fName)  with the following specifications :fName parameter represents the path name of a file + source code C + +. The return value represents an array of null terminated strings. For each  katholiko block of source code fName there is an element in the table return . The element is formed from the keywords and the operators of the respective blocks as follows : Each keyword (keyword) and / or operator (operator) encountered in block numbered and inserted numbered into string.  Different keywords and / or operators have a different numbering . Also , the numbers are different for each block . The string produced for each ledger(katholiko) block of insertion code will name it representation of keys .ledger,katholiko = called a code block that is not contained within another blockFor EXAMPLE:#include  #include  using namespace std ; void displayFile (const char * fName ) { //yellow area startifstream in; in.open (fName ); if (!in.is_open ()) { cout << fName << " not opened" << endl ; return; } char buffer [1024 ]; while (!in.eof ()) { in.getline (buffer , sizeof (buffer )); cout << buffer << 'n' ; } in.close (); } //yellow area finishint main (){ //green area startdisplayFile ("main.cpp" ); return 0; //green area finish}The code above has 2 ledger blocks: the body of  displayFile (yellow area) and the body of main (green area). Therefore, the key representation for the yellow and green blocks are respectively as follows:The yellow area have keywords as follows: 1 char, 2 cout, 1 endl, 1 if, 1 while and operands: 1 [, 3 (), 5., 2!, 1 return and 5 (. � Similarly, in the green region have keywords as follows: 1 return and operators: 1. 1 (. Accordingly, indexedKeysAndOPerators will return an array of size 2 to contains the following stringschar1, cout1, cout2, endl1, if1, return1, while 1, [1, ()1, ()2, ()3, !1, !2, (1, (2, (3, (4, (5, .1,.2, .3, .4, .5return1, (1, .1Add a main that takes as a parameter the name of a source code C + + andwill print on the screen the result of indexedKeysAndOPerators.A list of keywords and operators given in file keywords.txt. The order ofkeywords and operators can be changed in keywords.txt if deemed thatfacilitate the implementation of indexedKeysAndOPerators.keywords.txt 

Need this essay or a similar assignment written for you?

Top grades — AI & plagiarism free — delivered on time.
Place an Order →

Related Articles

3 pages paper ENG115

Assessment Brief Your boss has asked you (a communication specialist) to write an informative paper about opening a…

Read more →