Our Services

Get 15% Discount on your First Order

[rank_math_breadcrumb]

c++ social media platform

attached

CE221 – C++ Programming Assignment 2 – 24/25
Dr Michael Barros ([email protected])

Deadline: 13:59:59, Monday 13th January 2025

Notice

You should refer to sections 5 and 7 of the Undergraduate Students’ Handbook for details of the University policy
regarding late submission and plagiarism; the work handed in must be entirely your own. Your programs will be
checked by an intelligent plagiarism detection system that looks for similarities between the submitted programs.
(Since some of the code has been supplied on Moodle, there will inevitably be similarities, so I will examine any
submissions flagged by the checker to determine whether the similarities that have been detected are reasonable.)

This assignment comprises a single exercise. The files for use in this assignment are available in Moodle as a zip file.
Submission of this assignment will be via FASER.

Introduction

In this assignment, you will develop a basic social media content management platform (e.g. think of it as X (twitter) or
Reddit). The platform simulates a discussion of people and their posts with two types of distinct users:

1. Users: Individuals who read and write posts.

2. Managers: Individuals responsible for moderating the platform by setting and updating the content restrictions
(i.e., blocked words or phrases). They also moderate who can become a manager.

Your program will needs to display statistics about users reputation and help identify the top 10 most problematic
users based on their reputation scores.

Key Objectives

1. Provide a system where Users can read and write posts.

2. Provide a system where Managers can set and manage blocked content.

3. Display the top 10 most problematic users who have accumulated the lowest reputation scores (or are tied at zero
and have multiple moderated posts).

4. Allow Users to view their statistics (accumulated or average scores).

5. Implement a moderation engine that censors blocked content within posts.

User and Manager Options

User Options

1. Read/Write Post:

• Read a post : Randomly select a post from the platform’s database and present it to the user. After reading,
the user can choose to read another post, report the post (which lowers the post’s author’s reputation), or exit.

• Write a post : Prompt the user to write a post (up to 140 characters) and append it to the platform’s post file.

2. View Your Statistics: Show the user’s accumulated reputation score and average reputation per post. These
scores should be updated frequently and should use STL algorithms (of your choice).

3. Display Top 10 Most Problematic Users: Sort the users by their reputation score (lowest first using a class
operator overload). If there’s a tie at zero, break it by the number of moderated posts they have triggered. Display
the bottom 10. Use STL sorting and iterators.

4. Exit the Program

1

Manager Options

1. Reset Moderation Content: Clear all previously added banned words or phrases.

2. Add Blocked Content: Add new words or phrases that should be censored.

3. Add Another Manager: Only an existing manager can add a new manager by specifying their name and regis-
tration number.

4. Set the Sample File: Set or change the name of the text file that contains the platform posts.

5. Exit the Program

Content Moderation Engine

The engine must censor posts that contain blocked words or phrases. Every censored word or phrase should be replaced
by a series of ‘X’s of the same length, and every post that has been censored should include the #moderatedpost tag at
the end.

• Consider a “word” as a sequence of non-whitespace characters containing more than one letter.

• Remove punctuation at the start or end of words, but leave punctuation and digits that appear in the middle of
words.

• Convert all input to lowercase before checking for blocked content.

Examples:

• If “hate” is blocked: Original: “They truly hate her ideas.” Moderated: “They truly XXXX her ideas. #moderat-
edpost”

• If “cried all night” is blocked (a phrase): Original: “He cried all night after the announcement.” Moderated: “He
XXXXX XXX XXXXX after the announcement. #moderatedpost”

Classes and Files

You will be provided with files in the Assignment2files folder, including:

• Person.h and Person.cpp: A complete Person class (you may add extra members but do not alter existing ones
except where noted).

• User.h and Manager.h: Declarations for derived classes of Person. You must implement these in User.cpp and
Manager.cpp, respectively, following the specifications in the comments.

You may add extra member functions to these classes, but only define them in the .cpp files.

Additional Class: ReadPosts

You will have a ReadPosts class that:

• Reads a large text file of platform posts.

• Each record in the file may look like: userID postID post content date/time

• You will be given a partial implementation and a header file. Use these as provided.

• Implement a findPost function to select a random post from a multimap or similar container.

• If any file cannot be opened, terminate gracefully with an error message.

2

Main Program Requirements

1. Prompt for a username (or manager name) and determine their role.

2. If a User does not exist yet, create a new one and inform them using a try-catch statement.

3. If a Manager line is found, load their details. Only an existing Manager can add another.

4. Use a template function login to read from a user/manager file. For Users: Read registration, name, and scores,
and create User objects. For Managers: Read registration number and name, then create a Manager object.

5. After login, provide the respective menu options as described earlier.

6. You MUST use STL algorithms (for each, sort, etc.) and iterators, where pointed, but do not stop there.

7. Handle file I/O errors gracefully.

Challenge

Make the ReadPosts class behave like a custom iterable container (similar to a linked list). Use this custom iterator in
the top 10 calculation and in displaying the top 10 most problematic users.

Deliverables

Submit a single zip file containing a single folder. Acceptable formats: .zip, .7z, or a gzipped tar file. Other formats
lose 10%.

Include:

• All source files (.cpp, .h)

• A MAKE file for compilation

• Any required files for the program to run

Marking Scheme

Marking Criteria Marks
Style/Efficiency/Commenting 25
Implementation of all classes (User and Manager) 5
Main: User and manager options 20
Top 10 most problematic users 5
ReadPosts Class 15
Find post with find function 5
Requested usage of STL functions 10
MAKE file for compilation 5
Challenge 10
Total 100

Notes

Avoid unnecessary copying or repetitive code. Comments should clearly describe what each function does and what each
non-local variable represents. Within function bodies, use brief comments for groups of lines rather than every single
statement. Use the STL wisely.

Compile using the MAKE file and execute the application for testing.

Good luck!

3

Detailed Marking Scheme (Deductions)

Criteria for Mark Deductions Deduction (Marks)
S
ty
le
/

E
ffi
ci
en
cy
/

C
o
m
m
en
ti
n
g

M
ax

2
5
d
ed
u
c.

Poor code readability (inconsistent indentation, messy formatting). Up to -5
Unclear or non-descriptive variable/function names Up to -3
Redundant or duplicate variables/objects in memory Up to -5
Lack of or insufficient commenting Up to -5
Code not compiling fully Up to -10
Abrupt runtime interruption (crashes) Up to -10
Extra code unrelated to requirements Up to -10
Wrong submission format (not following instructions) Up to -10
Missing or incorrect implementation of required members in
User/Manager classes

Up to -5

Not using Template Function for login Up to -5
User/Manager registration not storing data correctly Up to -3
Authentication system failing to validate users properly Up to -2

P
la
tf
o
rm

D
ed
u
ct
io
n
s Required user/manager menu options not implemented (e.g., read/write

tweet, add blocked content)
Up to -10

User statistics (accumulative/average score) and top 10 wrong results Up to -5
Tie-breaking rules (e.g., #moderatedtweet count) not implemented Up to -5
ReadPosts class incomplete or non-functional Up to -10
Incorrect parsing or processing of platform posts Up to -5
Not using required STL functions (e.g., for each, sort) Up to -5
Not using iterators where specified Up to -5
No MAKE file or MAKE file not building correctly Up to -3
MAKE file does not compile all required sources Up to -2
Not implementing the custom iterable container as required Up to -5
Not integrating the custom iterator with sorting/iteration tasks Up to -5

Total Possible Deductions -100

4

Share This Post

Email
WhatsApp
Facebook
Twitter
LinkedIn
Pinterest
Reddit

Order a Similar Paper and get 15% Discount on your First Order

Related Questions

Computer Science Wk 2 assignment

Please see attachment for instructions provide a one-page response to the following topic below utilizing supporting documentation obtained from your textbooks and the Internet.  Be sure to include an APA Reference Page Topic: Assess the various Access Control methods.

Discussion and Replies

Please see attachment for instructions.       In 250 words total, answer the questions below with 4 evidence base scholarly articles. APA format. Based on the readings for chapter 3 Information Security Fundamentals and chapter 3&4 Information Security: Design, Implementation, Measurement, and Compliance, Discuss the following. 1. What are

How can businesses benefit from incorporating AI Integration Services into their digital transformation strategies?

[url= Integration Services[/url] are transforming businesses by streamlining operations, enhancing customer experiences, and enabling data-driven decisions. By automating repetitive tasks, AI frees up resources for more strategic activities, improving productivity. AI tools like chatbots and recommendation engines offer personalized solutions, fostering customer loyalty. AI also helps businesses analyze large datasets

OSINT Project 2

 Download the attached detailed assignment description for this project. You should also review the rubric shown below for additional information about the requirements for the project and how your work will be graded. Please make sure that you use both the assignment description file AND the rubric when completing your work. 

OSINT Project

Instructions Download the attached detailed assignment description for this project. You should also review the rubric shown below for additional information about the requirements for the project and how your work will be graded. Please make sure that you use both the assignment description file AND the rubric when completing your

D 6 of 459

Follow the attach instructions to complete this work Questions: 1. How is technology increasingly used in healthcare beyond electronic health records (HER)?  Give some examples. 2. Would you personally participate in robot assisted/telesurgery as a patient or a medical professional?  Why or why not? Resources 20 Examples Of IoT Wearables

D 5 of 459

Follow the attach instructions to complete the work. Questions: 1. What are service robots and how are they used and categorized?  Give examples of each. 2. How would you leverage service robots to improve the availability, confidentiality, and integrity of a large (20MW+) data center? Resources Robots as a Platform

ITS 10 Help

Ethical Hacking help Login to your NDG Online account. Complete the following labs. Each lab is worth 40 points. NDG Online account Link- Log In | NDG Online Portal ([email protected] Password: Starballplayer23$ 1. NDG Ethical Hacking Lab 10: Web Pentesting 2. NDG Ethical Hacking Lab 11: Client Side Exploitations After

InfSec

 Blockchain technology will revolutionize cybersecurity

ITS 12 Help

Ethical HAcking Login to your NDG Online account. Complete the following labs. Each lab is worth 40 points. NDG Online account Link- Log In | NDG Online Portal ([email protected] Password: Starballplayer23$ 1. NDG Ethical Hacking Lab 08: Password Cracking with JTR and Hashcat 2. NDG Ethical Hacking Lab 17: Creating

ITS 13 Help

Ethical Hacking  Login to your NDG Online account. Complete the following labs. Each lab is worth 40 points. NDG Online account Link- Log In | NDG Online Portal ([email protected] Password: Starballplayer23$ 1. NDG Ethical Hacking Lab 06: Network Analysis 2. NDG Ethical Hacking Lab 07: Evading IDS Submit Your Lab

Replies

please see attachment for instructions   In 400 word total, replying to the 2 post below. Each reply must be 200 word.      N.B Post #1 Hello classmates,   I am active duty in the military and currently on Eastern Standard Time. I have 4 kids, I’ve been in

channing 4.25 r studio work

follow the insrtuction Group Project Mostafa Rezaei Big Data (Introduction to Data Science) General information The group project gives you the opportunity to practice many of the skills we learned in the class. It includes 5 steps: Step 1: Find and describe a data set Find a publicly available data

Computer Science English Homework

● Assignment to do For this assignment, research different tools that cloud storage service providers use to manage the vast arrays of drives in their environments. Also, research the current performance and trends of the types of hard drives in use: magnetic vs. SSD. Summarize your research in a 2-3

SQL Help13

Statements and query For the final project, you will be working with a Guitar Shop.  You will need the MySQL server and MySQL workbench installed, just as it has been throughout the class. You will also need the following file: Project Requirements: 1. Execute the attached create_my_guitar_shop.sql to create the

Computer Science WK1 Assignment

Please see attachment for instructions and PDF book     W1 Assignment Instructions:   In 2 pages, answer the questions below with 5 evidence base scholarly articles in APA format.  Recommend and expand upon Information Security & Risk Management. 1. What are some internal and external security threats when dealing