Welcome to Live Chat

Welcome to LiveWebTutors Services, World's leading Academic solutions provider with Millions of Happy Students.

Call Back
logo

24x7 Support Available

To Get the Best Price Chat With Our Experts

chat now

In A Hurry? Get A Callback

shopping cart 0

Subject Solutions Code Description Price Delete

Amount Payable : $0

continue shopping proceed to checkout

World's Leading Assignment Library

EASTS - Social Network Program

Question Preview:

EASTS (online) Task Introduction A graph data structure is useful for representing networks, such as social networks, and a non-directed graph is particularly useful for this purpose. Social networks are non-directed, because it is assumed that if A knows B, then B knows A too. In this assignment, you are required to design and implement a simple social network program in Java. What to Implement (Tasks) Task 1 (15 marks) Write a social network program in Java. The default information for this network is stored in two files: index.txt and friend.txt. The file index.txt stores the names of...

View Complete Question >>

Question Preview:

EASTS (online) Task Introduction A graph data structure is useful for representing networks, such as social networks, and a non-directed graph is particularly useful for this purpose. Social networks are non-directed, because it is assumed that if A knows B, then B knows A too. In this assignment, you are required to design and implement a simple social network program in Java. What to Implement (Tasks) Task 1 (15 marks) Write a social network program in Java. The default information for this network is stored in two files: index.txt and friend.txt. The file index.txt stores the names of the people in the network – you may assume that we only store the given names and these names are unique; and friend.txt stores who knows whom. The program must read these two files. The following section describes the format of these two files. The friend.txt takes the following format. The first line is the number of pairs of friends. Each subsequent line has two integer numbers. The first two numbers are the indices of the names. The following is an example of friend.txt: 5 0 3 1 3 0 1 2 4 1 5 The index.txt which stores the names of the people in the network. The first line is the number of people in the file; for example: 6 0 Gromit 1 Gwendolyn 2 Le-Spiderman 3 Wallace 4 Batman 5 Superman The second line “Gromit” is the label for vertex 0, the third line “Gwendolyn“ is for vertex 1. For this system, we will only record the given names (without spaces). By looking at the content of these two files, we know that Gromit is a friend of Wallace and Wallace is a friend of Gromit. We also know that Gwendolyn knows Wallace and Wallace knows Gwendolyn, and so on. Unknown to Wallace and Gromit, Gwendolyn is a friend of Superman! To build the social network, the program reads both files. It uses friend.txt to build the vertices and edges of the social network, and use index.txt to label the vertices. If it fails to read the files (such as file not found),then it must also print appropriate error messages to System.err, such as: try{
 Scanner input = new Scanner(Main.class.getResourceAsStream("/friend.txt");
 …
 System.out.println("Input files successfully read");
}
catch(NullPointerException e){
 System.err.println("File Not Found"); 
} The program must also check that the number of relations or indices read is the same as the number of relations or indices specified at the start of each file. The two files above are kept short to simplify explanation and can be used when you first start developing the program. Eventually the program will be tested with larger datasets of about 20 friends and 30 pairs of friends. Task 2 - friends and friends' of friends list (10 marks) Prompt users for a name, say Wallace, and list all the friends that Wallace knows and all the friends that Wallace’s friends know. In this case, this list should be: Wallace, Gromit, Gwendolyn and Superman. This is a good way of checking that the program has built the network correctly. Please be mindful that users of this social network have low computer literacy, so the error messages have to be very easy to understand. If the given name does not exist in the network, the program should display an error message. If the network is completely empty, then the program should inform users that the network is empty as soon as they choose this option. Task 3 - friends list (5 marks) Prompt users for a name, say Wallace, and list all the people that Wallace knows. In the example above, Wallace has two friends and they are Gromit and Gwendolyn. The program should print appropriate messages when the given name does not exist or when the network is empty. Task 4 (15 marks) Prompt users for two names, say Wallace and Gromit, and list all the people that they both know. In this case, there is only one, and it is Gwendolyn. The program should print appropriate messages when the given name does not exist or when the network is empty. Task 5 (15 marks) Prompt users for a name to delete from the social network. When a member of the social network (vertex) is deleted from the network, all its edges must be deleted too. The program should print appropriate messages when the given name does not exist or when the network is empty. Note that friends of this social network are extremely hostile to those who have withdrawn themselves, so please seek confirmation before deleting anyone. Task 6 (15 marks) List all members sorted by popularity with the most popular members (having the highest number of friends) listed first, then within popularity sorted by name. The program must display the name and the number of friends (including a report title and column names). Task 7 (10 marks) Write a driver program to test all the functionality that you have implemented. The driver program should have a simple menu to allow users to: 1. Prompt users for a friend filename and an index file name. Note that the information read from these two files represents a new network. All information from the default or previous network will be replaced by this new network. 2. Prompt users for a name and list all the friends and friends of the friends (task 2). 3. Prompt users for a name and list all the friends (task 3). 4. Prompt users for two names, and list all the friends known to these two people (task 4). 5. Delete a member from the network (task 5). 6. List all members sorted by popularity, then by names (task 6). 7. Exit. Important Notes 1. Social networks are undirected graphs, so the program must add an edge from A to B and from B to A. 2. For tasks 2 to 5, if users enter a name that does not exist, then the program should inform users. Since this validation is required for several tasks, you might like to write a method which checks for the validity of the names. 3. If your program fails to read input files (task 1), other tasks will not be assessed and will be awarded 0 marks Design, Presentation and Conventions You need to think about the design of your program to allow code reuse. The Social Network Class should make use of the Graph class from Interact2 site under Resources. This graph class is directed, so you need to extend it by making use of inheritance so it becomes an undirected graph. You should also consider the number of lines in each method; Avoid writing long methods; Consider refactoring when the method exceeds 25 lines of code. Presentation is mainly formatting for aesthetic, while conventions cover issues like naming of classes, methods and variables as well as coding standards. We will use Google’s Java Style Guide as described inError! Hyperlink reference not valid.. Rationale This assignment requires you to use the Java programming language to: • Read input from text files. • Use a non-directed graph to build a social network. • Traverse a graph using depth first search. • Print error messages to System.err • Write a simple text based user interface. • Document Java programs using Javadoc. This assignment aligns with the learning outcomes: • be able to apply a variety of abstract data structures to the solution of well-defined problems; • be able to implement selected data structures in the Java language; • be able to design well-structured solutions to programming problems and implement these solutions in the Java language

View Less >>

Solution Preview

The solution in the zipped folder driver graph and index

question Get solution

$35

Orginal Price : $45.50

Pay Now

Upload Assignments

250 words

side

Get Your Assignment

Don’t delay more, place your order now. Quick assignment help will be offered to you.

Order Now

CUSTOMER REVIEWS

Excellent

logo

Based on 702 reviews See all reviews here

One of the Best Service

I trust LiveWebTutors for my assignments because of their ability to deliver the perfect assignments time and again. Only a few of my assignments required minor revisions. The rest assured it is the best assignment writing service in the market.

Elizabeth
Sydney

Great Service and on time

I felt so exhausted and burdened with the large number of assignments I had to write and desperately needed someone to help me with all the writing and there was LiveWebTutors company on the internet. They finished my assignments before the due date and also offered me a first-timer discount.

Christina
Perth

One of the Best Assignment Provider

I ordered my Mathematics and Marketing assignments from them last month. I received the content on the set date. Most importantly, the assignments were well-written and plagiarism free. I scored a top grade for the assignment written by them. They are a reliable company.

Oli
Brisbane

Very Helpful Customer Service

I was quite unsure about getting my assignment written online but after coming across LiveWebTutors.com, all my worries have vanished. The quality of the assignments written by their writers is just invincible. Their customer support is very polite and helpful. You should try their service at least once

Kabir
Adelaide