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

  Safeguards are associated with wireless communication

Create a discussion that address the risks and safeguards are associated with wireless communication

  What materials will you use in the study

What materials will you use in the study? Will you use an interview protocol? If so, then provide the protocol that you will use for a qualitative study

  What is the result of the receivers crc calculation

What is the result of the receiver's CRC calculation? Show your work. Does the receiver know that an error has occurred?

  Write compact code to avoid running out of memory

Cause the lift to return to the bottom of the shaft immediately if the Enter key (En) is pressed on the numeric keypad peripheral device.

  Describe the role of hardware components on a computer

Develop a 1,050-word summary describing the role of hardware components and operating system software on a computer.

  How does boosted tree behave in terms of overall accuracy

Predicting Delayed Flights (Boosting). Compared with the single tree, how does the boosted tree behave in terms of overall accuracy?

  Discuss what is meant by initializing the stack

Discuss the ways in which direct addressing occurs in the microprocessor. Discuss what is meant by initializing the stack.

  Imagine that a doubly linked list "header"

Assume that a doubly linked list "header" stores the elements of a priority queue. make use of the function pop(), which deletes the element with the largest value from the list (priority queue).

  Write an open frameworks program to generate a random

Write an open frameworks program to generate a random each to walk. At step, toss a coin determine if you move right/left or up down.

  What are the bc-dr best practices for any organization

What are the BC/DR best practices for any organization? What recommendations would you have for Wilmington University Library?

  Prepare chens er model diagram with 10 entities with

question 1.create chens er model diagram with 10 entities with attributes and 10 relationships.question 2.convert

  How well your function handles error situations

This first function, which you will implement in tools.c, will be used every time you need to start working on a new dictionary. Part of your grade on this implementation will be on how well your function handles error situations.

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