You are on page 1of 5

Challenge PART 2:

Social Media Platform


ECE 131L - Programming Fundamentals

1 Abstract
This challenge for ECE 131L aims to introduce students to the development
of a basic social media platform with a focus on data structures, algorithms,
and user interaction. The challenge covers various topics taught in class such as
arrays, strings, structures, file I/O, and basic algorithms, while also emphasizing
the importance of user experience and error handling.

2 Introduction
Social media platforms play a significant role in modern society, facilitating
communication, information sharing, and networking. In this challenge, stu-
dents will develop a simplified social media platform allowing users to create
accounts, post messages, follow other users, and view their feed.

3 Background
A social media platform typically consists of data structures to store user in-
formation, posts, and relationships between users. Basic algorithms are used to
implement functionalities such as posting messages, following users, and gener-
ating a user’s feed. Additionally, error handling and input validation are crucial
for ensuring a smooth user experience.

4 Methodology
The methodology for this challenge involves the following steps:
1. Define structures for User and Post, including attributes such as username,
password, email, post content, timestamps, etc.

2. Implement functions to perform actions such as creating a user account,


posting a message, following/unfollowing users, and generating a user’s
feed.

1
3. Utilize file I/O to store and retrieve user information, posts, and relation-
ships between users, ensuring data persistence across program executions.
4. Implement error handling and input validation to provide a seamless user
experience and prevent program crashes.

5 Expected Results
The expected result of this challenge is a functional social media platform that
allows users to create accounts, post messages, follow/unfollow other users, and
view their feeds. Users should be able to register with a unique username,
post messages with timestamps, follow/unfollow other users, and see posts from
users they follow in their feeds. Additionally, the system should handle errors
gracefully and provide informative messages to users in case of invalid input or
other issues. See the ”C template” for additional expectations.

6 Code Requirements
Students are required to implement the following functions along with necessary
data structures:

6.1 Create Account


The create account function should allow users to create a new account.

Function Signature
void create_account(User *users, int *num_users);

Example Implementation
void create_account(User *users, int *num_users) {
// Implementation to be provided by the student
}

Functionality
The function should prompt the user to enter their username, password, and
email, and then add the new user to the users array.

6.2 Post Message


The post message function should allow users to post a message.

Function Signature
void post_message(User *users, int num_users);

2
Example Implementation
void post_message(User *users, int num_users) {
// Implementation to be provided by the student
}

Functionality
The function should prompt the user to enter their username and the message
they want to post, and then add the message to the user’s list of posts.

6.3 Follow User


The follow user function should allow users to follow another user.

Function Signature
void follow_user(User *users, int num_users);

Example Implementation
void follow_user(User *users, int num_users) {
// Implementation to be provided by the student
}

Functionality
The function should prompt the user to enter their username and the username
of the user they want to follow, and then update the list of users they follow.

6.4 Generate Feed


The generate feed function should generate a user’s feed based on the users
they follow.

Function Signature
void generate_feed(User *users, int num_users);

Example Implementation
void generate_feed(User *users, int num_users) {
// Implementation to be provided by the student
}

Functionality
The function should prompt the user to enter their username and then display
the messages posted by users they follow, sorted by timestamp.

3
6.5 Additional Tasks
Students should further enhance the social media platform by implementing the
following additional tasks:

6.6 Unfollow User


Allows users to unfollow a user they previously followed.

Function Signature
void unfollow_user(User *users, int num_users);

Functionality
The function should prompt the user to enter their username and the username
of the user they want to unfollow, and then update the list of users they follow
accordingly.

6.7 Delete Account


Allows users to delete their account.

Function Signature
void delete_account(User *users, int *num_users);

Functionality
The function should prompt the user to enter their username and password for
confirmation, and then remove their account from the system.

6.8 User Authentication


Implement user authentication to ensure secure access to user accounts.

Function Signature
bool authenticate_user(User *users, int num_users);

Functionality
The function should prompt the user to enter their username and password and
verify if the credentials match any existing user accounts.

6.9 Privacy Settings


Implement privacy settings for user accounts, allowing users to control who can
view their posts.

4
Functionality
Add privacy settings to user accounts, allowing users to choose whether their
posts are visible to everyone, only to their followers, or only to themselves.

7 Evaluation Criteria
Students will be graded based on the following criteria:
• Correctness of the implementation: Does the program produce the ex-
pected output?

• Was logic used in algorithm design and code?


• Clarity of the code: Is the code well-written and easy to understand?
• Did the student demonstrate proficiency in essential programming con-
structs?

• Were functions implemented appropriately to achieve desired functional-


ity?
• Was parameter passing used effectively to manipulate data within func-
tions?

• Were pointers utilized correctly to manage memory and data structures?


• Did the student demonstrate an understanding of error handling and input
validation?
• Did the student demonstrate an understanding of user experience princi-
ples?
• Did the student demonstrate an understanding of file I/O for data persis-
tence?
Students can use the provided template ”template.c” as a starting point for
completing the challenge. They should fill in the implementation details for
each function and task according to the requirements provided in the challenge
description. See the ”C template” for additional requirements.

8 Conclusion
By completing this challenge, students will gain practical experience develop-
ing a basic social media platform focusing on data structures, algorithms, user
interaction, and error handling. They will deepen their understanding of con-
cepts learned in the class such as arrays, strings, structures, file I/O, and basic
algorithms, while tackling a real-world problem.

You might also like