Java “app” program improvement

Part I:
Split your app source code into separate files. Each class or interface should have its own file, except very small classes like Exceptions, which could be in the file for the class that uses them.
Add all classes and interfaces except your main class to a package. You’ll need to import them into your main class.


Part II:
Create a content.txt file for user-generated content data on your social network (posts or  tweets or stories, etc.) and load them into a global list, similar to how the users are loaded. 
Each piece of content should have an associated User that authored it.

Update your Social Network program so it can handle missing or bad data in the input files.

You’ll need to catch exceptions that could be thrown if e.g. a file is missing or a data format is bad.

You’ll probably also need to throw exceptions if e.g. a piece of data is missing or wrong.

Situations you might want to consider include:

1. Users file (people.txt) is missing

2. Relationships file (relationships.txt) is missing

3. There are not enough pieces of data for a user.

4. There are not enough pieces of data for a relationship.

5. A piece of data is the wrong format (e.g. a birthday is “potato” or a number is “potato”.)

6. A name in the relationships.txt file is of a person who doesn’t exist.

For this assignment, you’ll be building two feeds of user-generated content.

The logged in user

For both feeds, you’ll need to select a user for whom the feeds will be. We can call this the “logged in user”, in the sense that this is the user that’s logged into our app and we’re presenting the feeds to.

The logged in user can be any user in your system; you can choose the first user in your list, or the last, or a random, or anything else you’d like. Please keep in mind I’ll change the list of users and posts as I test your app, so don’t hard-code a user’s name or something similar. 

The main feed

The main user feed is simply a feed of the content posted by all users that the logged in user follows/is friends with. 

The content should be in order of posting: e.g. if the following content exists, in this order:

Post 1 by user A

Post 2 by user A

Post 3 by user B

Post 4 by user C

Post 5 by user A

Post 6 by user D

and our logged in user follows user A and user C, they should see the posts in this order in their main feed:

Post 1 by user A

Post 2 by user A

Post 4 by user C

Post 5 by user A

The recommended feed

The recommended content feed is made up of the content posted by the logged in user’s “recommended users”. The recommended users are the users that are followed/friends of the users that the logged in user is following/is friends with. 

(Users that the logged-in user follows are not recommended users, even if another user they follow follows them as well.)

In other words, if the logged in user follows users A and C, and user A follows B and C, and C follows D and F, the logged in user’s “recommended users” are B, D and F. 

The assignment

Display the logged-in user, the first 10 pieces of content from main feed, and the first 10 pieces of content from their recommended feed. 

You can stop displaying all users and all content.

Task: Update your Social Network program so that it loads a list of users, and a list of their relationships, from two files:

people.txt contains a list of the users with all the data needed to create each user: name, date of birth, age, or whatever other information about your user your program stores. Each person is on a separate line. The different fields are separated by a symbol (I recommend the vertical line “|”, it’s on the same key as “\”).

relationships.txt contains a list of relationships (friendships, follows, family relationships, or whatever else your social network tracks). Each relationship lists the names of both people in the relationship on each line. The different fields are separated by a symbol (I recommend the vertical line “|”, it’s on the same key as “\”).

Example files are attached.

Notes:

1. The data in the files is always text data. If the data you need for your Users is something other than String, e.g. a number or Date, you have to handle the converting of that data from String to the correct format.

2. Files.readLines() and string.split() are your friends.
3. string.split(“|”) will treat “|” as a special character and won’t work as you expect. To do what you want, you have to use \ to tell it not to treat it as a special character: string.split(“\|”)

Research Paper 101
Calculate your paper price
Pages (550 words)
Approximate price: -

Reasons to trust Research Paper 101

On Time Delivery

We pride ourselves in meeting the deadlines of our customers. We take your order, assign a writer but allow some more time for ourselves to edit the paper before delivering to you. You are guaranteed a flawless paper on a timely manner...

24x7 Customer Live Support

Our team at Research Paper 101 is committed to handling your paper according to the specfications and are available 24*7 for communication. Whenever you need a quick help, you can talk to our writers via the system messaging or contact support via live chat and we will deliver your message instantly.

Experienced Subject Experts

Online Experts from Research Paper 101 are qualified both academically and in their experiences. Many are Masters and Phd holders and therefore, are qualified to handle complex assignments that require critical thinking and analyses...

Customer Satisfaction

We offer dissertation papers as per students’ wishes. We also help craft out the best topics and design concept papers. By ordering with us, you are guaranteed of defending and making through those hard faced professors in the defense panel!

100% Plagiarism Free

We at Research Paper 101 take plagiarism as a serious offence. From the start, we train our writers to write all their papers from scratch. We also check if the papers have been cited appropriately. Our website also has a tool designed to check for plagiarism that has been made erroniusly. In essense, the paper you get will be 100% legit...

Affordable Prices

We understand that being a student is very challenging, some students balance between work and studies in order to survive. We therefore offer pocket friendly rates that are very competitive in the market.

Try it now!

Calculate the price of your order

Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

No need to work on your paper at night. Sleep tight, we will cover your back. We offer all kinds of writing services.

Essays

Essay Writing Service

No matter what kind of academic paper you need and how urgent you need it, you are welcome to choose your academic level and the type of your paper at an affordable price. We take care of all your paper needs and give a 24/7 customer care support system.

Admissions

Admission Essays & Business Writing Help

An admission essay is an essay or other written statement by a candidate, often a potential student enrolling in a college, university, or graduate school. You can be rest assurred that through our service we will write the best admission essay for you.

Reviews

Editing Support

Our academic writers and editors make the necessary changes to your paper so that it is polished. We also format your document by correctly quoting the sources and creating reference lists in the formats APA, Harvard, MLA, Chicago / Turabian.

Reviews

Revision Support

If you think your paper could be improved, you can request a review. In this case, your paper will be checked by the writer or assigned to an editor. You can use this option as many times as you see fit. This is free because we want you to be completely satisfied with the service offered.

error: