السلام عليكم
تحياتي العطره لكم
لدي سؤال احتاج من يشرح لي
A sentence can be defined as a group of words. Develop a Sentence Class according to the following:
• Assume the maximum number of words in a sentence is five.
• The sentence should be empty at the beginning. Then, the user should add the word in the order. I.e. The user can not add the second word while the first word is empty and so on.
• Your class should include the following member functions:
o AddWord(): add a received word at the end of the sentence. The function should return true when the word is inserted correctly and false otherwise.
o Size() : which returns the number of words in the sentence.
o PrintSentence() : print the sentence.
o ReplaceFirstWord() : replace the first word by a received word.
o ReplaceLastWord(): replace the last word in a sentence by a received word
• Separate the class interface from implementation.
• To test your class write a main() function that define a sentence of a t least three words. Try to call all functions.
تقبلوا تحياتي

