Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ program Statement An acronym is a sequence of characters that is used to ref

ID: 645094 • Letter: C

Question

C++ program

Statement
An acronym is a sequence of characters that is used to refer to something
with a very long name. An acronym is generated from a long name by
capitalizing the first letter of every word in the name and concatenating
them together. There are three exceptions: the common words "and",
"the", and "of" are ignored when generating the acronym. In this problem, a
word is defined as one or more non-space characters preceded by either a
space or the beginning of the string and followed by either a space or the
end of the string. Write a class VLNString with a method makeAcronym that
takes a string longName and returns a string with its acronym generated as
described above.
Definition
Class: VLNString
Method: makeAcronym
Parameters: string
Returns: string
Method signature: string makeAcronym(string longName)
(be sure your method is public)
Notes
- longName may contain leading and trailing spaces, and there may be more
than one space between words.
- The return value may be an empty string.
Constraints
- longName will contain between 1 and 50 characters, inclusive.
- longName will contain only lowercase English letters ('a' to 'z') and space
characters.
Examples
0)
"dance dance revolution"
Returns: "DDR"
1)
" return of the king "
Returns: "RK"
Problem A5

Returns: "RK"
2)
"the united states of america"
Returns: "USA"
3)
" of the and "
Returns: ""
4)
" "
Returns: ""
SRM 226 DIV 2

Explanation / Answer

#include

using namespace std;

class VLNString

{

   public:

     

      // Member functions declaration

     

;

};

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote