Start by downloading the assignment files. This zipfile contains a makefile, a test script and inputs/ground truths, and stubs for all of the .cpp files you need. Please do not create any additional .h and .cpp files.
Consider the function shown below. The function returns true if the letters in the word are in alphabetical order, false otherwise.
bool alpha(string s){ int ln = s.size(); for (int i = 0; i < ln - 1; ++i){ if (s[i] > s[i+1]){ return false; } } return true; }
Consider the character comparison as the barometer instruction (s[i] > s[i+1]). Implement this function in C++ in the file words.cpp. The makefile contains a definition for words. You can build the executable words for this part of the assignment by running "make words". ("make" or "make all" will build both words and the executable for the second part of the assignment.)
Determine the following for English words, using the provided list in file wordlist (do not convert to lowercase).
Note words.cpp contains code for reading wordlist.
uname@hostname: ~$ ls average_comps.txt average_comps.txt uname@hostname: ~$ gnuplot comps.p uname@hostname: ~$ ls average_comps.png average_comps.png
Please use the provided file mode.cpp, and fill in the function mode. Note: you must write any auxialliary functions you use, and may not include any external libraries to help (other than iostream and fstream). The makefile contains a definition for mode. You can build the executable mode for this part of the assignment by running "make mode".
The zipfile contains a testing script, test.py. You should run this, and other test cases, to verify correctness of your mode function.
You should submit your assignment online to the CourSys submission server. You should submit the following:
Please read the documentation on the submission site for further information. The assignment is due at 11:59pm on March 1.