Menu

[Solved] One Show Code Using Class C Q37178247

Does any one can show me the code for that below using classin C++
For this program, your MYString variables will never need to grow beyond length 20, in program 3 you will need to be allow yoThe MYString class will need to have the following member functions: Programming Note: Write and test one or two functions atFor this program, your MYString variables will never need to grow beyond length 20, in program 3 you will need to be allow your string that is held in the class to be able to be larger than 20 chars. So you may want to start allowing your strings to be able to grow…..if you have extra time. If you are optionally building in the ability to grow, it should start with a capacity of 20, but when needed it would grow in increments of 20. The capacity should always be a multiple of 20. For example if we were storing the string “cat” in a MYString object, our data member would have the following values: starting addr of dynamic str array cap 20 3 end Dynamic array: The MYString class will need to have the following member functions: Programming Note: Write and test one or two functions at a time Member Functions Description return type Default Constructor: creates an empty string creates a string that contains the information from the argument example: MYString greeting “hello there wise one”); MYString) MYString (const char*) length(): int the length of the string ( “cat” would return 3) the total amount of memory available for use (always 20 in this version, but in the next version, this will change) capacity(): int Show transcribed image text For this program, your MYString variables will never need to grow beyond length 20, in program 3 you will need to be allow your string that is held in the class to be able to be larger than 20 chars. So you may want to start allowing your strings to be able to grow…..if you have extra time. If you are optionally building in the ability to grow, it should start with a capacity of 20, but when needed it would grow in increments of 20. The capacity should always be a multiple of 20. For example if we were storing the string “cat” in a MYString object, our data member would have the following values: starting addr of dynamic str array cap 20 3 end Dynamic array:
The MYString class will need to have the following member functions: Programming Note: Write and test one or two functions at a time Member Functions Description return type Default Constructor: creates an empty string creates a string that contains the information from the argument example: MYString greeting “hello there wise one”); MYString) MYString (const char*) length(): int the length of the string ( “cat” would return 3) the total amount of memory available for use (always 20 in this version, but in the next version, this will change) capacity(): int

Expert Answer


Answer to Does any one can show me the code for that below using class in C++… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *