Question: 8. Implement the Dots class shown below that represents a string of zero or more dots (i.e. periods). For example Dots d(4) would represent a

 8. Implement the Dots class shown below that represents a stringof zero or more dots (i.e. periods). For example Dots d(4) wouldrepresent a string with four dots: ".... Recall, we can add acharacter to the end of string s using the + or +=operator. For examples += '.' adds a period to the end of

8. Implement the Dots class shown below that represents a string of zero or more dots (i.e. periods). For example Dots d(4) would represent a string with four dots: ".... Recall, we can add a character to the end of string s using the + or += operator. For examples += '.' adds a period to the end of s. #include #include using namespace std; class Dots { friend ostream& operator=0. Dots operator* (int k) const; // like *=, but don't modify *this. void print (ostream & out, bool endline = false) const; // output s and possibly an endl. private: string s; }; Dots::Dots (int n) string Dots::get() const void Dots::set(int n) Dots Dots:: operator++ (int dummy) Dots & Dots::operator++ ( ) Dots & Dots:: operator*=(int k) Dots Dots :: operator* (int k) const void Dots: :print (ostream & out, bool endline) const

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!