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
#include
#include
#include
using namespace std;
// FUNCTION PROTOTYPES GO HERE:
string getPhrase(const string & prompt);
int charIndex(const vector & list, char letter);
void updateFreq(vector & list, int index);
void addLetter(vector & letters, vector & freqs, char letter);
void displayLetters(const vector & letters, const int colwidth);
void displayFreqs(const vector & 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