Answer to Question #255386 in C++ for saf

Question #255386

Write code for a CharacterSequence class so that is compatible with both the given main and FrequencyCounter files.


1
Expert's answer
2021-10-23T03:03:30-0400


#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS