Reference no: EM132931386
Task
Your task is to write a program, words, that reports information about the number of words read from standard input. For example, if the file qbf .txt contains the text the quick brown fox jumps over the lazy dog then running the program with its input redirected to come from that file will report 9 words
$ words .g qbf .txt
Total: 9
Before you begin, you will need to check out the practical directory from the topic subversion repository. This can be achieved with the svn utility. Open a command prompt, change into your local CP2 practical directory, and enter the following command (replacing FAN with your FAN):
The check out process will create a words directory representing your working copy. You will need to write all of your code within this directory, so be sure to change into it before reading on.
Automatic marking
This practical is available for automatic marking via the FLO quiz Prac 4 hand-in. To check your solution, first commit your code to the topic repository by typing
svn commit -m "replace this sentence with a suitable commit message"
and then enter the revision number into the answer box for the relevant question (level). There are no penalties for incorrect solutions, so if you fail one or more of the test cases, check the report output, modify your solution, and try again. Remember to finish and submit the quiz when you are ready to hand in. You may complete the quiz as many times as you like; your final mark for the practical will be the highest quiz mark achieved.
Background
The following skeleton code for the program is provided in words .cpp, which will be located inside your working copy directory following the check out process described above.
int main (int argc, chars* argv)
{
enum { total, unique } mode = total;
for (int c; (c = getopt(argc, argv, 'Yu")) != -1;)
9d itch(c) { case 't':
mode = total;
break; case 'u':
mode = unique;
break;
}
}
argc -= optind;
argv -= optind;
string word; int count = 9;
How is genetic diversity maintained
: How is genetic diversity maintained in a flowering plant versus a fern?
|
Angiosperms and gymnosperms on plant phylogenetic
: 1. According to the phylogenetic tree, is phylum Echinodermata more closely related to phylum Chordata or phylum Arthropoda? Explain your answer.
|
Different chemical gas components of the air we breath
: What are the different chemical gas components of the air we breath?
|
Sketch a line on the graph
: Rodents that live alongside a river tend to be three colors - dark brown (BB), beige (B'B'), or light brown in the middle (BB'). The environment around the rive
|
Write a program about the number of words read from input
: Your task is to write a program, words, that reports information about the number of words read from standard input
|
Explain some elimination to the patients phi
: Case study; Cognitive processes are mental activities postulated by cognitive psychology as top-down and bottom-up, cognitive routines, change-of-task modules,
|
Steps of triple response and the hormones involved
: A plant is damaged badly during a storm. Afterward the plant goes through Triple Response. What are the 3 steps of Triple Response and the hormones involved.
|
Explain the three domains of life
: List and explain the three domains of life. Define taxonomy, and list the eight levels of classification (beginning with domain).
|
Why are necessary in the dna extraction process
: In other words, why are these necessary in the DNA extraction process? Please use complete and descriptive sentences when formulating your answers. Banana
|