A program to count words and numbers in a plain text file

Assignment Help Computer Engineering
Reference no: EM132194678

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: EM132194678

Questions Cloud

Elasticity of demand for a given product or services : What are the two primary factors that determine the elasticity of demand for a given product or services?
Display all subsets of the characters : n the problem, your program should read n characters from a user and display all subsets of the characters.
Explain consistent patterns in feelings and behaviour : HPS307/791 PERSONALITY ASSESSMENT, DEAKIN UNIVERSITY, AUSTRALIA. Explain consistent patterns in thoughts, feelings and behaviour
How it distinguishes normal and inferior goods : Define income elasticity and how it distinguishes normal and inferior goods.
A 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.
A program to calculates a vehicles gas mileage : The program should ask the user to enter the number of gallons of gas the vehicle can hold and the number of miles it can be driven on a full tank.
Write a description of the selected dataset and project : ITECH1103- Big Data and Analytics - write a brief reflection about this project in terms of challenges, learning and contribution
Calculate the monthly cost of a house given selling price : Write a C++ program to calculate the monthly cost of a house given the selling price, annual rate of interest, and number of years for the loan.
Market for housing as a result : Suppose that consumers begin to believe that the price of housing will be lower next period. What will happen in the market for housing as a result

Reviews

Write a Review

Computer Engineering Questions & Answers

  Write down a method definition to count

Write down a class declaration for a student that has String first, last, and middle names as data fields. Declare only the data members and a no-arg constructor.

  Write a java class that can take any red-black tree

Write a Java class that can take any red-black tree and convert it into its corresponding (2,4) tree and can take any (2,4) tree and convert it.

  Entity-relationship diagrams

Develop an entity relationship diagram for the case, stating any assumptions you seem as essential.

  Questionsql queriesdownload stovesaccdb access database in

questionsql queriesdownload stoves.accdb access database in doc sharing it has following tables filled with

  Create the logic for a program that merges the files

Create the logic for a program that merges the files for January and February to create a list of all books borrowed in the two-month period.

  What is the probability that the hand is all spades

Suppose we deal a 5 card hand from a standard deck. What is the probability that the hand is all Spades, given that it has at least two Spades?

  Write down a sub query by using the books and publisher

write a sub query using the books and publisher table to list the isbn book title and the retail price for every book

  List and describe down the components of a data center

List and describe down the components of a data center. What did you learn in this process and how will this practice be applicable to your real world career?

  Calculates the cutoff frequency in a simple rc circuit

Write a simple Java application which calculates the cutoff frequency in a simple RC circuit. Your application should ask the user to enter the capacitor and resistor values of the circuit. You must use the JOptionPane class to collect the user's ..

  A program called minishell that creates two child processes

Write a C language program called minishell that creates two child processes: one to execute 'ls' and the other to execute 'sort'.

  Design a web page that provides a list of resources

Design a Web page that provides a list of resources for free clip art and free photographs. The list should contain at least five different Web sites.

  Explain the sampling and non-sampling risks

Sampling and Non-sampling Risk. This module provided a detailed example of the use of sampling to determine whether individuals could increase their driving.

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