Programming Assignment 10


Due: Week of Nov. 14 in lab


Using inheritance, write a basic social network. Your network will resemble some elements of Facebook. There should be an Account super class. Two types will extend Account, Person and Page. There should be a Relationship super class. Two types will extend Relationship, Friend and Follow. You should also have a client program for the social network that defines the main.

Name the files Account.java, Person.java, Page.java, Relationship.java, Friend.java, Follow.java, and SocialNetwork.java.

Other details:

Example output of SocialNetwork's test:
Person
Account name: Jory Denny
Number of friends: 1
Number of follows: 1
Friends
Friend. Relationship created Mon Nov 14 10:15:13 EST 2016. With Zachary Pollock.
Follows
Follow. Relationship created Mon Nov 14 10:15:13 EST 2016. Following Zen-Do-Kai Karate.

Person
Account name: Zachary Pollock
Number of friends: 1
Number of follows: 1
Friends
Friend. Relationship created Mon Nov 14 10:15:13 EST 2016. With Jory Denny.
Follows
Follow. Relationship created Mon Nov 14 10:15:13 EST 2016. Following Zen-Do-Kai Karate.

Page
Account name: Zen-Do-Kai Karate
Number of followers: 2

Bonus. Provide an example of polymorphism in your product, either with relationships or accounts. Other extensions: provide a feed and post mechanism for accounts using Strings.