ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 20 May 2017 My Price 9.00

Create a C++ file named benford.cpp

Assignment

  1. Create a C++ file named benford.cpp.
  2. In benford.cpp, your main function should prompt for the name of a data file and then the function iterates through the all of the elements in the data file and computes the frequency (count and percentage) of the first number in each entry. 
  3. Note: Some of the data files have comments that you must filter out.
  4. Also note: that blank lines or lines where the number begins or is 0 must also be filtered out.
  5. Your output must be formatted as follows.
    DigitCountFrequency
    130.30
    220.20
    320.20
    400.00
    500.00
    600.00
    720.20
    800.00
    910.10

Sample Data Files

Clarification, from this list your program must be able to handle sample1.txt, sample2.txt, sunspots.txt, livejournal.txt, and librarybooks.txt.

  • sample1.txt - small sample input file with no degenerate cases.
  • sample2.txt - small sample input file containing blank lines and 0's.
  • Sunspot data (Links to an external site.) collected by Robin McQuinn. The number of sunspots that occur monthly, as compiled by a Belgian agency taken from http://sidc.oma.be/html/sunspot.html.
  • LiveJournal starts (Links to an external site.) collected by Shirley Man. The number of new LiveJournal accounts created daily Jan 1, 2000–Feb 28, 2005, taken from http://www.livejournal.com/stats/stats.txt, field name "newbyday".
  • Library holdings (Links to an external site.) collected by Christian Ayotte. The number of books held in a set of several thousand US libraries, from an Access database at: http://nces.ed.gov/pubs2004/data/PUPLD02a_Access.zip.

101481109741013282923504035372715572849611026175

Attachments:

Answers

(11)
Status NEW Posted 20 May 2017 09:05 AM My Price 9.00

-----------

Not Rated(0)