Implement a program that collects the statistics of word

Assignment Help C/C++ Programming
Reference no: EM131847084

Assignment

Statement of Work: Implement a program that collects the statistics of word, number, and character usage in a file (redirected as the standard input).

Requirements:

1. Create a subdirectory called proj1.

2. For this project you need to create at least two files: proj1.cpp, and makefile. Both files should be placed in the proj1 directory.

3. The file proj1.cpp should contain the main function, int main(). In the main() function, the program should read the input until it reaches the end, counting the number of times each word, number, and character is used. A word is defined as a sequence of letters ('a'..'z' or 'A'..'Z'). Words are case insensitive ("AA", "Aa", "aA", and "aa" are the same). A number is defined as a sequence of digits ('0'..'9'). Note that both words and numbers can be of length of 1, that is, contain one letter or one digit, respectively. Different sequences represent different numbers. For example, number "001" is different from number "1". Words are separated by numbers or other non-letter and non-digit characters. Numbers are separated by words or other non-letter and non-digit characters. Your program should record the number of times each word, number, and character happens. The program should then output the ten most used characters, the ten most used numbers, and the ten most used words as well as the number of times these characters/numbers/words are used. Since words are case insensitive, the program only outputs lower case words. The characters, numbers and words should be outputted in the descending order based on the number of times they are used. When two characters happen in the same number of times, the character with a smaller ASCII value should be considered as being used more frequently. When two words (numbers) happen in the same number of times, the word (number) that occurs earlier in the input should be considered as being used more frequently.

4. An example executable code of the program proj1.x is provided to you. In proj1.x, the output related to the display of characters, words, and numbers is aligned in the following manner: the width of the column of the characters, words, and numbers is the length of the longest words and numbers to be displayed, plus five (5). You should make the outputs of your program the same as those of 'proj1.x'. When printing characters, use '\t' for tab and '\n' for newline. All other characters should be outputted normally.

5. Write a makefile for your project that compiles an executable called proj1.x

6. You are encouraged to use any C++ STL containers and algorithms. You should also use C++ string class instead of the built-in string type.

7. Your program must be able to compile and run on linprog.

Reference no: EM131847084

Questions Cloud

What is the age-crime curve : What is the age-crime curve? What do you think causes the variation in offending by age?
Generate a consumption constellation : Identify three distinct "taste cultures" within your school. Can you generate a "consumption constellation" for each (clothing, music, leisure activities, etc.)
Preparation or baking in the kitchen : The pizza parlor can make and bake a pizza in 15 minutes. There are, on average 8 pizzas in preparation or baking in the kitchen. How many customers
How we should build brand : How we should build brand? It should be internationally to reach correct audience. Those audience should be of business target users to get good visibility.
Implement a program that collects the statistics of word : Implement a program that collects the statistics of word, number, and character usage in a file (redirected as the standard input).
What value of alpha : What value of alpha, the smoothing constant, was the firm using?
How does all that acquired knowledge influence the way : How does all that acquired knowledge, some of which is conflicting, influence the way in which YOU will manage people, i.e. your own management "style".
List of work packages and activities : 1.A well-thought out SOW should include a list of Work Packages and Activities required to deliver the project.
Percentage change in productivity over the past two years : A parcel delivery company delivered 103,300 packages last year, when its average employment was 84 drivers. This year the firm handled 112,340 deliveries

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Calculate the surface area and volume of the sphere

Calculate the surface area and volume of the sphere. Finally  the surface area and the sphere should be printed onto the screen. The printing statements

  Write a program using the rand() function

Write a program using the rand() function and a large array to find the standard deviation, variance and mean as well as the min and max values of the array.

  Recognize a string typed in as a valid or invalid

Use regex to recognize valid Social Security numbers.  A valid Social Security number consists of three digits, an optional hyphen, two digits, an optional hyphen, and four digits.

  Program that asks the user to enter a number from 1 to 50

Print the statement "Programming is fun" the number of times entered by the user using a for loop.

  Program to input the length of the side from the keyboard

write a program to input the length of the side from the keyboard ,use the class to obtain the areas of all shapes and display the results on the screen

  Create two integer variables x and y and an integer array z

Create two integer variables x and y, and an integer array z[5]. Set the variable x equal to 5, and the variable y equal to 10. Save the following values in the array: 1, 2, 4, 8, 16

  Write a digital music manager

Your DMM program must have a text-based interface which allows the user to select from a menu of options including: load, store, display, insert, delete, edit, sort, rate, and exit. The "load" option reads records from a file into a dynamic doubly..

  Create author-filename

FILENAME: title of the source file,SPECIFICATION: description of the program

  Write a program for keeping a course list

Write a program for keeping a course list for each student in a college. The information about each student should be kept in an object that contains the student's name and a list of courses completed by the student.

  What output will be produced if the exception is thrown

What output will be produced if the exception is thrown with the constructor with parameters with the following actual parameter?

  Square and colour of the square

A player generates two random numbers. Ex: generated number is 2 & 3 the player clicks in the 2x3 square and colour of the square should change.

  Read in data from an input file (qstr.txt).

It will print the output and say that it is NOT palindrome which leads me to believe it is missing something somehow.

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