C++ Programming Code

Hi,

Here’s a description of the code:

For this assignment you will be writing a function: 

LetterCounter countLetters(int numStrings, char** stringList).

The return type is a class named LetterCounter (more on this later) containing an array with the counts for each of the 26 letters, normalized to lower case,  as well as another integer member for the total number of letters counted. The parameter int numStringsgives the length of the array of string pointers in char** stringList.

Requirements

You will be creating a project with 3 files that MUST be exactly named (capitalization and all):

  1. LetterCounter.cpp

  2. LetterCounter.h

  3. TestDriver.cpp (this file will be given to you)

You will be writing 1 function that MUST be exactly named (capitalization and all):

  1. LetterCounter countLetters(int numStrings, char** stringList)

Each File Serves the following purpose:

LetterCounter.h

LetterCounter.h will contain your class declaration as well as your function declaration.

LetterCounter.cpp

LetterCounter.cpp will contain your LetterCounter countLetters(int numStrings, char** stringList) definition. You do not need to write separate definition for your class (the declaration is enough). You function should operate as described below. Remember that classes are way for us to define our own data types so the return type of this function is LetterCounter.

The function you write serves a purpose

LetterCounter countLetters(int numStrings, char** stringList);

The parameters to the function will have the following memory model:

With these inputs you will iterator over each string in char** stringList and then iterate over each character in that string, incrementing the count for each individual normalized alphabetic character. Non-alphabetic characters should be ignored.  To normalize characters you may use your function from PSA[2> or you may use the “char tolower(char input)” function provided by the C++ language. Remember the number of strings you are iterating over is given as by the int numStrings parameter.

The return type is a class you will declare in your header file. It contains two members:

  1. int totalLettersCounted

  • This is the total number of letter counted across all strings in the list

  • int letterCounts[26]

    • This is an array containing the counts for each individual letter.

    • ‘a’ is in index 0, ‘b’ is in index 1, ‘c’ is index 2 etc.

    It’s memory model will look like this with 5 letters counted total: 2 a’s, 1 y and 2 z’s):

    Is int numString positive? Is the parameter char** stringList NULL? Make sure to check these things before trying to use them!

    ALSO MAKE SURE YOU TEST YOUR INPUTS TO MAKE SURE THEY MAKE SENSE!

    Is int numString positive? Is the parameter char** stringList NULL? Make sure to check these things before trying to use them!

    For this assignment I will also be providing your with a test driver TestDriver.cpp. This file will contain the main() function and will use your code to get the letter frequencies of a given list of strings. It will then print this output to the screen. Note that this is just a sample input and when we are actually grading this assignment we will be using other inputs as well.  

    TestDriver.cpp can be located here: TestDrive.cpp

    https://drive.google.com/file/d/0ByzTlffqfUOBZkFobGFmWU1RUHM/view?pli=1

    Place your order
    (550 words)

    Approximate price: $22

    Calculate the price of your order

    550 words
    We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
    Total price:
    $26
    The price is based on these factors:
    Academic level
    Number of pages
    Urgency
    Basic features
    • Free title page and bibliography
    • Unlimited revisions
    • Plagiarism-free guarantee
    • Money-back guarantee
    • 24/7 support
    On-demand options
    • Writer’s samples
    • Part-by-part delivery
    • Overnight delivery
    • Copies of used sources
    • Expert Proofreading
    Paper format
    • 275 words per page
    • 12 pt Arial/Times New Roman
    • Double line spacing
    • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

    Our guarantees

    Delivering a high-quality product at a reasonable price is not enough anymore.
    That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

    Money-back guarantee

    You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

    Read more

    Zero-plagiarism guarantee

    Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

    Read more

    Free-revision policy

    Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

    Read more

    Privacy policy

    Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

    Read more

    Fair-cooperation guarantee

    By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

    Read more
    error: Content is protected !!