Question
design and develop an JAVA application Program to generate Two Contact Reports, Old Friends and New Friends Reports. The application starts by reading Friend information
design and develop an JAVA application Program to generate Two Contact Reports, Old Friends and New Friends Reports.
The application starts by reading Friend information from a file "AllFriendsFile" (Name - yearofmeeting), then asking the user if he/she wants to add each friend to the list.
? If the user wants to keep a specific friend, then the program will ask for the friend's city.
? If the user does not want to keep the friend with his/her list, that friend will be ignored. Now, for each friend, we have Name, year of meeting read from the file, and city read from the keyboard.
The program will create a Friend object for each friend. If the friend's year of meeting is before 2000, then the friend information will be printed to"OldFriendReport". Otherwise, if the year of meeting is after 2000, the friend information will be printed to "NewFriendReport".
You should create and use the following classes:
MainApp
? Implement the main logic for the problem using the developed classes and methods.
Contact Class
? Should have fields like name, yearOfMeeting and city.
? Accessor and mutator methods for the fields
? Constructor to set default values to fields.? Print function to return a string containing the contact information.
Example:
AllFriendsFile contains this list:
Mary
2019
Sharon
1988
Jone
2015
Lee
2000
Smith
1990
Sample implementation:
What is the file name that has friends' info
Friends
Do you want to add Mary To your new Contact List?
y
Enter the address of Mary
Toronto
Do you want to add Sharon to your new Contact List?
y
Enter the address of Sharon
London
Do you want to add Jone to your new Contact List?
n
Do you want to add Lee To your new Contact List?
y
Enter the address of Lee
Rome
Do you want to add Smith To your new Contact List?
y
Enter the address of Smith
Toronto
After finishing this implementation, we should have this output in the two reports:
OldFriendReport
Classes --
Created the Contact class as requested with the needed fields and methods (3 points)-
Created the MainClass with main function as requested (1 points)
NewFriendReport Old FriendReport Old FriendReport The friend nane is Sharon I met him/her in 1988. He/She now in London The friend nane is Lee I met him/her in 2000. He/She now in Rome The friend name is Smith I met him/her in 1990. He/She now in Toronto NewFriendReport The friend name is Mary I met him/her in 2019. He/She now in Toronto
Step by Step Solution
3.40 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
Heres the best way to solve it Expertverified Share import javasql import javautil import javaawtevent import javaawt import javaxswing public class MyStudentOracle6 extends JFrame implements ActionLi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started