Write a program about the number of words read from input

Assignment Help Programming Languages
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;

Reference no: EM132931386

Questions Cloud

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

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd