TEST YOUR CODE THOROUGHLY. Determine boundary cases such as when the user just hits the enter key or types only spaces or leading spaces. Your program must not have a run- time error.
Here is a template :
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;
// FUNCTION PROTOTYPES GO HERE:
string getPhrase(const string & prompt);
int charIndex(const vector<char> & list, char letter);
void updateFreq(vector<int> & list, int index);
void addLetter(vector<char> & letters, vector<int> & freqs, char letter);
void displayLetters(const vector<char> & letters, const int colwidth);
void displayFreqs(const vector<int> & freqs, const int colwidth);
int main()
{
// Define your local variables
const int COLUMNWIDTH = 2;
// Prompt the user for the input string by calling function getPhrase
// Loop through each character in the input phrase and update vectors
// Call the functions charIndex, updateFreq, and addLetter here
// Display letters and frequencies by caling functions displayLetters and displayFreqs
return 0;
}
// FUNCTION DEFINITIONS GO HERE