Write code for a CharacterSequence class so that is compatible with both the given main and FrequencyCounter files.
#include <iostream>
using namespace std;
class CharacterSequence{
private:
char c;
public:
void setChar(char i){
c=i;
}
char getChar(){
return c;
}
void display(){
cout<<"\nCharacter = "<<getChar();
}
};
int main()
{
CharacterSequence c;
c.setChar('A');
c.display();
return 0;
}
Comments
Leave a comment