BY USING JAVA NETBEANS PORGRAM I need the code java file Ema
BY USING JAVA (NETBEANS) PORGRAM
I need the code (.java file)
Email Inbox
Assume that you are designing an email system consisting of Inbox that contains all the emails you have received. You need to create a class Email that contains the following:
int ID;
string subject;
string content;
EmailID from; (EmailID is another class described below that represents email ID in the format someone@somewhere.com)
Time receivedAt; (Time is another class described below that represents time in the format hr:min:sec)
Time repliedAt; (if email has been replied, this notes the time of reply)
bool replied; (by default, this should be false)
string importance; (for example, “low”, “medium”, “high”)
Email next;
An EmailID class should contain the following:
string ID; (for example “ahmed”)
string domain; (for example “pmu.edu.sa”)
The Time class should contain the following:
int hr;
int min;
int sec;
You should create a variable of type email, say “Inbox”, as the head of the database which points to the first email object in the linked list.
Email Inbox = NULL; //this is the head of the linked list. Don’t call it head.
You should provide functions to support the following operations:
1.Add a new email in the list (take input from user, all the fields and add a new email)
2.Delete an email from the list (based on “email ID”).
3.Print all the emails in the entire list.
4.Delete all the emails in the entire list.
5.Reply to an email (take email ID as input and set the “repliedAt” field to true and set the time of reply to the current time)
6.Print all the emails based on://atleast choose 2
a) subject
b) some string key in the content
c)from a particular email ID
d) received at particular time
f) replied at a particular time
e) of a particular importance (for example, print all emails of importance=high)
s) whether email reply has been sent or not
Output Screen:
When I run the project, it should show me a menu where I can select, from several given options, whatever I want to do. Now, after I see the menu, I will make a selection, say from 1 to 10. Based on my selection, your program should call some function to carry out the operation needed for that selected task. After that operation is performed, you should show me the above mentioned selection menu again. This should continue in an infinite loop until I want to exit the program.
Finally, remember that you should write a function FillDatabase (…) that should populate the entire database for Inbox before you bring your code for assessment
The following diagram shows how the linked list should look like. These are \"next\" pointing at object type \"Email\" Inbox int ID; string subject, string content; EmailID from Time received Time replied, bool replied; string importance, Email next roject Output Screen: 546Solution
Hello, as per Chegg\'s guidlines I\'m entitled to answer at least 4 sub parts of the question but I have finished almost all. Due to time contarint and for your learning purpose left 6th sub part for you to complete. Find the following code which you can copy in any java IDE and generate .java file. Code might have bugs due to time constarints I wasn\'t able to do trials. 6th part is fairly easy if you can understand 2nd part. import java.text.SimpleDateFormat; import java.util.*; public class Email { int ID; String subject; String content; EmailID from; //(EmailID is another class described below that represents email ID in the format someone@somewhere.com) Time receivedAt; //(Time is another class described below that represents time in the format hr:min:sec) Time repliedAt; //(if email has been replied, this notes the time of reply) Boolean replied; //(by default, this should be false) String importance; //(for example, “low”, “medium”, “high”) Email next; //constructor for Email class Email(int ID, String subject, String content, EmailID from, Time receivedAt, Time repliedAt, Boolean replied, String importance, Email next){ this.ID = ID; this.subject = subject; this.content = content; this.from = from; this.receivedAt = receivedAt; this.repliedAt = repliedAt; this.replied = replied; this.importance = importance; this.next = next; } public static void main(String[] args){ Email Inbox = null; LinkedList
