1 1 Description of the Program In this assignment, you will write four java files, Message.java, MessageTester.java, Mailbox.java and MailboxTester. java, Stage 1: In the first file Message.java, create a class named Message that models an email message. It should contain the following: • Private instance variables sender, recipient, and messagetext; • A default constructor that takes no inputs (set all members to an empty string); • A constructor takes all three inputs (sender, recipient and messagetext); • Three getter methods to return each of three instance variables (accessor); • Three setter methods to change each of three instance variables (mutator); • A method toString that makes the message into one long string like this: From: Harry Morgan To: Rudolf Reindeer This is my message... Stage 2: In the second file MessageTester.java, write code to test the methods that you write in the class of Message.java. Specifically: 1. Create two message objects using the constructor taking inputs. The inputs are from "messages0.txt’. You can either read the file into message objects, or you can manually initialize the objects using the information from the file. 2. Print them out using toString() method. 3. Set each object using setter methods (Inputs, e.g., CurrentSender1, CurrentRecipient1). 4. Display each object's information using getter methods. Your output should look like Figure 1. Stage 3: In the third file Mailbox.java, create a class named Mailbox that models a mailbox that contains a list of email messages. It should contain the following:
1 1 Description of the Program In this assignment, you will write four java files, Message.java, MessageTester.java, Mailbox.java and MailboxTester. java, Stage 1: In the first file Message.java, create a class named Message that models an email message. It should contain the following: • Private instance variables sender, recipient, and messagetext; • A default constructor that takes no inputs (set all members to an empty string); • A constructor takes all three inputs (sender, recipient and messagetext); • Three getter methods to return each of three instance variables (accessor); • Three setter methods to change each of three instance variables (mutator); • A method toString that makes the message into one long string like this: From: Harry Morgan To: Rudolf Reindeer This is my message... Stage 2: In the second file MessageTester.java, write code to test the methods that you write in the class of Message.java. Specifically: 1. Create two message objects using the constructor taking inputs. The inputs are from "messages0.txt’. You can either read the file into message objects, or you can manually initialize the objects using the information from the file. 2. Print them out using toString() method. 3. Set each object using setter methods (Inputs, e.g., CurrentSender1, CurrentRecipient1). 4. Display each object's information using getter methods. Your output should look like Figure 1. Stage 3: In the third file Mailbox.java, create a class named Mailbox that models a mailbox that contains a list of email messages. It should contain the following:
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Expert Solution
Step 1
The answer is given below:-
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education