Java Data Abstract & Structures

I need to add a diagram for my assignment. You can change my code

Get Help With a similar task to - Java Data Abstract & Structures

Login to view and/or buy answers.. or post an answer
Additional Instructions:

esign and implement an application that maintains the data for a simple social network. Each person in the network should have a profile that contains the person's name, an image(extra credit), current status(Online, offline, busy,...), and a list of friends. Your application should allow a user to join the network, leave the network, create profile, modify the profile, search for other profiles, and add and remove friends. use java · You need to implement CRUD (In computer programming, create, read, update, and delete (CRUD) are the four basic functions): · C= Create: Add profile- Add friends · R= Read: Read the information of a profile - Search for other profiles · U= Update: Update and edit the profile - Update the friend list · D= Delete: Delete a profile - Delete a friend of a profile. · You need to have a class diagram for your program (A simple one is acceptable): Following are my projects. Could you help me add a class diagram for them? You can change the projects. Profile class import java.util.ArrayList; import java.util.List; public class Profile { public Profile(String name) { this.name=name; this.status="Online"; } private String name; private String image; private String status; private List<Profile> friend=new ArrayList<Profile>(); public String getName() { return name; } public void setName(String name) { this.name = name; } public String getImage() { return image; } public void setImage(String image) { this.image = image; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public List<Profile> getFriend() { return friend; } public void setFriend(List<Profile> friend) { this.friend = friend; } public void addFriend(Profile profile) { this.friend.add(profile); } @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("[name="); builder.append(name); builder.append(", image="); builder.append(image); builder.append(", status="); builder.append(status); builder.append(", friend="); builder.append(friend); builder.append("]"); return builder.toString(); } } Test.java import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class Test2 { private static List<Profile> profiles=new ArrayList<Profile>(); public static void main(String[] args) { Scanner scanner=new Scanner(System.in); System.out.println("Please select option: "); System.out.println("1 for Add a new Profile "); System.out.println("2 for Search Profiles "); System.out.println("3 for Update and edit the profile "); System.out.println("4 for Delete a profile "); System.out.println("-1 for quit "); int iProfile=scanner.nextInt(); if(iProfile==-1) { scanner.close(); return; }else if(iProfile==1) { System.out.println("Please enter name for profile :\n"); String name=scanner.next(); if(name!=null && name.trim()!="") { Profile profile=new Profile(name); System.out.println("Please enter profile picture url :"); String profilePicture=scanner.next(); profile.setImage(profilePicture); profiles.add(profile); } main(new String[] {}); }else if(iProfile==2) { System.out.println("Profile at this Network"); for(Profile profile: profiles) { System.out.println(profile); } main(new String[] {}); }else if(iProfile==3) { System.out.println("Please select profile which you want to update: "); for(int i=0; i<profiles.size(); i++) { System.out.println(i+" for "+profiles.get(i)); } System.out.println("-1 for return to main menu"); int uProfile=scanner.nextInt(); if(uProfile==-1) { main(new String[] {}); }else { Profile profile=profiles.get(uProfile); System.out.println("select profile adding friend"); for(int i=0; i<profiles.size(); i++) { System.out.println(i+" for "+profiles.get(i)); } System.out.println("-1 for return to main menu"); int fProfile=scanner.nextInt(); if(fProfile==-1) { main(new String[] {}); }else { profile.addFriend(profiles.get(fProfile)); main(new String[] {}); } } }else if(iProfile==4) { System.out.println("Please select profile whose friend you want to delete"); for(int i=0; i<profiles.size(); i++) { System.out.println(i+" for "+profiles.get(i)); } System.out.println("-1 for return to main menu"); int dProfile=scanner.nextInt(); if(dProfile==-1) { main(new String[] {}); }else { System.out.println("select friend of "+profiles.get(dProfile).getName()+" want to delete"); for(int i=0; i<profiles.get(dProfile).getFriend().size(); i++) { System.out.println(i+" for "+profiles.get(dProfile).getFriend().get(i)); } System.out.println("-1 for return to main menu"); int aProfile=scanner.nextInt(); if(aProfile==-1) { main(new String[] {}); }else { profiles.get(dProfile).getFriend().set(aProfile, null); } } } } }

Related Questions

Similar orders to Java Data Abstract & Structures
7
Views
0
Answers
Nested imbalanced design of expriment using Box-Adjusted wald-type test
I need to provide statistical analysis of a nested design non-balanced design of experiment. I am hoping to have the implementation in either R, SPSS, or both. I will need the answers to be provided as shown in the attached file (Project.docx), and also wo...
27
Views
0
Answers
CMPT 200 Coding Homework
Write a class called Fraction that can store a rational number (reminder: those numbers that can be expressed in the form a/b, where a and b are integers are rational numbers). For example, a variable with a value of ½ would be created using oneHalf ...
14
Views
0
Answers
Artificial Inteligence System Technique
This is a Master Degree course and I have attached example questions, there are 5 questions and only 3 need to be answered. We will get the actual questions on the day of the exam and they need to be completed within 2 hours, which means the expert has to ...
18
Views
0
Answers
Simulating Networks
Here are the details of first assignment for Computer Networks class. This is a pretty basic assignment with very little work but you will have to do initial setup for virtual box on your machine. Here are the details on how to do the setup: Download virt...