Count words and numbers in a plain text file

Assignment Help Computer Engineering
Reference no: EM132194657

Write a C++ program to count words and numbers in a plain text file. Words and numbers can be repeated. You can use any algorithm and data structures that you prefer, as long as the results are correct.

It is preferred, but not necessary, that your algorithm is as efficient as possible, both in processing time as well as memory management.

The input is one text file, with words and integers, separated by any other symbols including spaces, commas, period, parentheses and carriage returns. Keep in mind there can be be multiple separators together (e.g. many spaces, many commas together). The input is simple.

You can assume a word is a string of letters (upper and lower case) and a number a string of digits (an integer without sign). Words and numbers will be separated by at least one non-letter or one non-digit symbol. Length: You can assume one word will be at most 30 characters long and a number will have at most 10 digits.

Repeated strings: words and numbers can be repeated. However, you are not asked count distinct words or compute frequency per word, which require algorithms and data structures to be covered in the course. Therefore, you just simply need to count word or numver occurrences.

For this homework we will not ask you to consider all potential inputs. Notice you are not asked to handle floating point numbers, which require decimal point and scientific notation.

Reference no: EM132194657

Questions Cloud

What is the penguin speed : A 6.1 kg penguin is sliding on a frictionless horizontal surface with an initial speed of 7.1 m/s. A varying magnitude force is applied in the direction.
What is the role of government in a democracy : Imagine that you are trying to convince a friend or family member about the importance of voting. What would you say to them?
What kinds of political cultures do your nation-states have : What kinds of political cultures do your nation-states have? Briefly explain the reasons behind these facts.
What is the speed of the physics student : A 59 kg physics student jumps off the back of her Laser sailboat (42 kg). After she jumps, the Laser is found to be travelling at 1.5 m/s.
Count words and numbers in a plain text file : Write a C++ program to count words and numbers in a plain text file. Words and numbers can be repeated.
Compute the average value of an array of floating-point : Write a c++ program that computes the average value of an array of floating-point data.
Compute the profit made for selling goldfish flakes : Write a C# program to compute the profit made for selling goldfish flakes on-line, using Visual Studio.
Write a c program to capitalize the first character : Write a C program to capitalize the first character in each sentence from a given file.
What is the power expended by each girl : Two girls, each of weight 400N climb up a rope through a height of 8 m. We name one of the girl And other B. Girl takes 20 sec while B takes 50 sec.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Create an array that represents recommended ratings for user

Create an array that represents recommended ratings for the user. There should be 20 numbers in this array, one for each movie.

  What type of planning did or did not take place

Use the Internet to locate one incident of disaster recovery that was successful and one incident that was not successful.

  What are the two rules that a reference monitor enforces

What are the two rules that a reference monitor enforces? What properties are required of a reference monitor?

  Developing the modular program

Develop the modular program which asks user in order to enter the monthly costs for following expenses incurred from the operating his or her automobile: loan payment, gas, insurance, oil, tires, and maintenance.

  Write a driver program to test all your methods

Give the definition of a class named Doctor whose objects are records for a clinic's doctors. Write a driver program to test all your methods.

  What are the speech and auditory devices

What's the difference between Anthropomorphic design and Non anthropomorphic design. What are the speech and auditory devices ?

  Describe the tools used by the assembly language programmer

Describe the differences between assembly language and high-level languages as regards type checking. Describe tools used by the assembly language programmer.

  What smallest number of stack frames required by superpowers

ACTIVITY: Questions for superpowers. What's the best case? I.e., for a given n, what's the smallest number of stack frames required by superpowers

  Develop a menu-driven program that inputs two numbers

Develop a menu-driven program that inputs two numbers and at the user's option, finds their sum, difference, product or quotient.

  Name the guidelines and additional decisions which can be

question 1 which of the guidelines and additional decisions can be incorporated in an automatic statistical thesaurus

  Calculate number of vertices that appear on fourth level

Calculate the number of vertices that will appear on the fourth level. You may reduce the size of the tree by taking advantage of symmetries.

  What is standard purchasing system

SPS system would standardize purchasing practices for each Snad and Surf subsidiary and manage all purchasing information. System testing will be completed by end of the week. What kinds of documentation are required for this application?

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