Starting from:

$25

COMP2540-Assignment 1 Solved

Write a computer program that allows the user to store information about Facebook posts. For each post, the user wants to store the number of likes and the number of comments the post received. The name of the post owner (facebook account name), the size of the post (number of characters in the post), and the date of the post. The date could​ ​be​ ​string​ ​ ​ ​(e.g.​ ​"2017_05_22"​ ​)​ ​or​ ​a​ ​number​ ​(e.g.​ ​20170522).

 

When​ ​the​ ​program​ ​executes​ ​it​ ​should​ ​ask​ ​the​ ​user​ ​to​ ​select​ ​one​ ​of​ ​the​ ​following​ ​options

1.     Display​ ​the​ ​stored​ ​posts

2.     Display​ ​the​ ​first​ ​post​ ​with​ ​a​ ​given​ attribute​ ​​value​ ​(e.g​ ​post​ ​author​ =​​ ​John)

3.     Display​ ​the​ ​current​ ​total​ ​number ​​of​ ​ ​stored​ ​posts 

4.     Store the data of a new post. (​note that all the attributes are required and can not be​ ​null)

5.     Delete​ ​a​ ​post​ ​by​ ​one​ ​the​ following​ ​​options​ ​(post​ ​date,​ ​post​ ​author).

6.     Delete​ ​all​ ​the​ ​stored​ ​post.

7.     Sort the post based on one of the following post attributes ( number of likes, number​ ​of​ ​comments,​ ​date,​ ​or​ ​post​ ​size) 

8.     Exit Notes:

●       Your program should only terminate if the user press option ​"7 Exit" ​otherwise it should​ ​continue​ ​processing​ ​user's​ ​requests.

●       Select the appropriate data structure to store the post information. Make sure you can​ ​justify​ ​your​ ​selection. 

●       Use​ ​functions​ ​to​ ​organize​ ​your​ ​code.

●       Make sure that your program does not crash if the user enter invalid data input at any​ ​point​ ​during​ ​the​ ​program​ ​execution.

More products