Question: database management 2 5. (10 points) Create a class called Message that models an email message. A message has a recipient, a sender and a
5. (10 points) Create a class called Message that models an email message. A message has a recipient, a sender and a message text. It also has a Class/Static variable called numMessage. a. An email message has three properties: sender, recipient and text. b. Write a constructor that takes a sender and a recipient as arguments. It also increments the class variable by 1. c. Write a method append that adds/sets text to the message text. Should this method have any arguments or return a value? Is this a mutator or an accessor method? d. Write a method composeMessage that formats the recipient, sender and message text into one long string like this "From: Harry Morgan To: Mary Smith Message:..." and returns it. Should this method have any arguments or return a value? Is this a mutator or an accessor method? e. Print the class/static variable in your Tester class
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
