Assignment title: Information
Tasks
Remember, it's considered good practice to include some comments in programs and shellscripts, to explain the author's design and logic. Include your name and student number in a comment near the top of each of your shellscripts.
1. In Assignment-1, you developed a simple command or shellscript to produce a list of unique "words" in a textfile. For this task, you're asked to modify your previous work, and develop a rudimentary spelling checker.
On Apple OS-X platforms, the file /usr/share/dict/web2 provides a collection of words found in the 1934 edition of Webster's International Dictionary - one word per line. On Linux platforms, a similar file is usually named /usr/share/dict/linux.words.
For this task, let's more rigorously define a "word" to be three or more lowercase characters. Now, with reference to the dictionary on your system, develop a command or shellscript that finds the words in a textfile that do not appear in the dictionary - potential spelling errors.
2. The CSV file (comma-separated-values) university-enrolments-2015.csv provides Australian Government collated enrolment numbers from Australian universitiies in each state in 2015 (original source DET, 17th August 2016). For each state, enrolments are classified as either domestic or overseas (with students from New Zealand classified as domestic students).
For this task:
o write a shellscript that finds the university with the highest ratio of overseas students.
o extend your shellscript to find the university with the highest ratio of overseas students in each state.
(Don't forget, you don't need floating-point values to calculate percentages or ratios - just perform the arithemtic using integers).
3. The ZIP file calcmarks.zip contains a number of (text) files containing a program written in the C programming language (there's no need to understand C for this task). The program, when compiled with the command cc -std=c99 -o calcmarks *.c -lm
calculates the correlation-coefficient and line of best fit, for 2-column data. Download the ZIP file, and expand it into your working directory.
A helpful programming practice is to place comments in source code files to indicate the whole program's version number and, possibly, the release date. You'll notice that the provided source code files all contain the C comment:
// calcmarks, version 1, released Thu Sep 15 14:26:09 WST 2016
For this task you are required to write a shellscript, named updateversion, which updates the comment found in each C source code file so that it (now) contains the next version number, and the current date/time as the next release date. For example, after successfully running your shellscript, each C source file will contain a comment, such as:
// calcmarks, version 2, released Mon Sep 19 08:16:19 WST 2016
Do not assume that the project (collection of source files) will always be called calcmarks (it won't!). Instead, assume that the project is named after the source file containing C's main()function. For this example, the indicative line int main(int argc, char *argv[]) is located in the file calcmarks.c, and so that's where the project gets its name.