Design a class named Message to represent a sentence or phrase. The class will contain: •...

80.2K

Verified Solution

Question

Programming

Design a class named Message to represent a sentence or phrase.The class will contain: • a private string data field to hold thesentence or phrase. • A no-arg constructor with an empty stringmessage.

• A constructor that create a message object with the specifiedstring sentence or phrase.

• Accessor and mutator (getter/setter) for string datafield.

• A method named getVowels ( ) that returns the number of vowelsin a sentence or phrase.

• A method named getConsonants( ) that returns the number ofconsonants in a sentence or phrase.

• A method named getDigits( ) that returns the number of digitsin a sentence or phrase.

• A method named getUpperCase( ) that returns the number ofuppercase letters in a sentence or phrase.

• A method named getLowerCase( ) that returns the number oflowercase letters in a sentence or phrase. Draw a UML diagram forthe Message class and then implement it. Write a test program touse the class and demonstrate all methods in the message class.

What do I include as part of the solution ?

• UML diagram for message class.

• Algorithms (flowchart or pseudocode, 25 pts)

for the following methods: getVowels(), getConsonants( ),getDigits (), getUpperCase ( ), getLowerCase ( ). Use a pdf file tosubmit the flowchart. Remember to include a legend of the variablesused as part of the solution.

• JAVA source codes (source.java) – class and demo program ( 25pts )

Answer & Explanation Solved by verified expert
4.1 Ratings (721 Votes)
SOLUTION Below is the java codeCODE java    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students