You need to create a class Message that represents an email message. This class,
ID: 3691031 • Letter: Y
Question
You need to create a class Message that represents an email message. This class, for instance, can be used in implementation of a mail server. The class must declare the following attributes: Sender (type String) List of recipients (array of Strings) Timestamp (type String) and methods: void setSender(String S) String getSender() void addRecipient(String S) String[] getRecipients() int getNumOfRecipients() String getTimeStamp() String toString() Message() It is assumed that maximum number of recipients is set to 10 (hint: to be used as size of the array where you store recipients). Also it is assumed that timestamp must be evaluated at the time of object creation (functionality to be implemented in class constructor). Method toString() is expected to return String representation of the Message object
Explanation / Answer
The class:
class message
{
Sring sender,recipients[10],timestamp;
void setSender(String S)
{
}
String getSender()
{
}
void addRecipient(String S)
{
}
String[] getRecipients()
{
}
int getNumOfRecipients()
{
}
String getTimeStamp()
{
}
String toString()
{
}
Message()
{
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.