CSE 231代写、代做Python编程设计
CSE 231 Spring 2025
Computer Project 07
1. Assignment Overview (learning objectives)
This assignment focuses on the design, implementation and testing of a Python program which uses classes to
solve the problem described below. Note: you are using a class we provide. You will develop a program that
allows the user to interact with the VibeNet platform, a Python-based social media platform supplied by
instructors.
This assignment will give you more experience in reading code and the use of:
● Dictionaries
● Functions
● Classes and OOP
Prohibitions:
• You are NOT allowed to use global variables.
• You are ONLY allowed to use concepts up to and including week 13.
2. Important Note about submission
3. Assignment Deliverable
• We provide a zip file on the course website that you need to download into your computer, unzip the
file, and open it in PyCharm (similar to the lab) to access the starter code.
• Every project has a video and a document to get you started with the project. The video is posted on the
same page of the course website as the instructions. Watch the project video for more help with the
problem-solving part.
• To finalize and submit your code:
1- Click on the assignment link in D2l for the first time.
2- Write or copy your code in CODIO in the tab named proj07.py
3- Click on the button “Code Co@ch Buddy”. This will grade your assignment. Then, a window
appears with your grade information. Expand the window to see the details and explanations. Click
on the links (pink or blue) to get feedback on your assignment. You can then use the feedback to
improve your grade.
4- Once you are satisfied with your work, make sure to click on “Mark as Completed” to submit your
code and avoid any late penalties.
This assignment is worth 50 points (5.0% of course grade). It must be completed before 11:59 PM EST on Monday,
April 14th.
After the due date (04/14), your score will be deducted by 2% for every 1 hour late or a fraction of it. No
submissions will be accepted after 24 hours from the due date. Penalty will be applied on the full project score.
The project will be automatically submitted by the due date (04/14). If you want to keep working on it after the
deadline with penalty, you must manually click on “Mark as uncompleted”, acknowledge the penalty message and
manually click on “Mark as completed” when done.
4. Assignment Specifications and Requirements
4.1. General Requirements
These are general requirements that you need to satisfy to ensure a full score:
1. Items 1-9 of the Coding Standard will be enforced for this project:
http://www.cse.msu.edu/~cse231/General/coding.standard.html
2. Per the syllabus, if you "hard code" answers, you will receive a grade of zero for the whole project.
3. You should only use materials covered in class up to week 13 (videos and textbook).
4. You have to implement at least 12 functions.
a. A good practice is to have functions that perform one task at a time. It makes your code more
readable.
b. Any function that you create needs to be used in your code.
c. There must be a function named main()(check section .2.2 for more details about the project
specifications). The main function is called by:
d. There must be at least 11 other functions that do something meaningful (it is good to have more
functions).
4.2. VibeNet: A Social Media Platform (provided in vibenet.py)
VibeNet is a Python-based social media platform that enables users to
create, share, and engage with content. The platform allows users to post
updates, interact with other users through likes and comments, search for
content based on hashtags or dates, and maintain a personal profile with
follower statistics. The system is designed with an emphasis on
engagement, and user interaction:
● User Authentication and Management
o Users can sign up with a unique username and password.
o Users can login with authentication.
● Content Creation and Interaction
o Users can create new posts with textual content.
o Posts have attributes such as likes, comments, and engagement scores.
o Users can like and comment on posts.
o Comments are stored and displayed with user information.
● Post Management
o Users can edit and delete their own posts.
o Posts include metadata such as creation date and author.
● Search and View Newsfeed
o Search posts by hashtags.
o Search posts within a date range.
o View newsfeed sorted by engagement score and date.
if __name__ == '__main__':
main()
● Other Features
o Profile page displaying user details and created posts.
o List of all users sorted by popularity.
o Posts and user information are loaded from external files.
These are the classes that are provided in the vibenet.py, and you have to use the attributes and the methods.
Make sure to go through the file and understand the methods in each class. Otherwise, you will not be able to
understand what you should do.
Post Class:
● Purpose: Represents a social media post.
● Attributes:
o post_id: Unique identifier for the post. (will be incremented by 1 for new posts)
o user_id: ID of the user who created the post.
o content: Text content of the post.
o like_count: Number of likes on the post.
o comment_count: Number of comments on the post.
o comments: List of comments on the post.
o date: Date when the post was created. (April 14, 2025 for new posts)
o author: Username of the post creator.
● Methods:
o get_engagement_score(): Calculates the post's engagement score.
(like_count * 0.5 + comment_count * 1)
o edit_content(): Allows the author to edit the post.
o can_modify(): Checks if a user has permission to modify the post.
User Class:
● Purpose: Represents a user on the VibeNet platform.
● Attributes:
o user_id: Unique identifier for the user. (will be incremented by 1 for new users)
o username: User's chosen username.
o password: User's password. (follows some constraints)
o followers: Number of followers. (0 for new users)
o following: Number of users being followed. (0 for new users)
o posts: Dictionary of user's posts.
● Methods:
o display_profile(): Displays user profile information.
VibeNet Class:
● Purpose: Manages users, posts, and interactions within the platform.
● Attributes:
o users: Dictionary mapping user IDs to User objects.
o posts: Dictionary mapping post IDs to Post objects.
● Methods:
o read_users_file(): Loads user data from users.txt file.
o read_posts_file(): Loads post data from posts.txt file.
o search_posts_by_date(): Finds posts within a given date range.
o add_user(): Registers a new user.
o add_post(): Creates a new post.
o display_user_posts(): Displays all posts by a specific user.
o get_user(): Retrieves a user by their ID.
4.3 Your tasks: proj07.py
You will develop a program that allows the user to interact with the VibeNet platform. The program will use the
instructor-supplied vibenet.py module to design the posts, the users and the vibenet platform. To help
clarify the specifications, we provide sample output of a correctly implemented python program below in the
Sample Output section. We also provide a proj07.py file that contains the starter code. Your program must
use the import statement for vibenet.py. You should not modify the vibenet.py file otherwise you will
not pass the tests as we will be using our own vibenet.py file that is identical to the file provided in the
starter code.
Creating the platform:
You are provided with three data files. The hidden tests will use the same files. You should create a VibeNet
object using the following 3 files:
1. users.txt: contains user ID, user name, password, followers’ count, number of profile that
the users are following.
2. posts.txt: contains post ID, user ID who posted, post content, like count, comment count,
and date.
3. post_comments.txt: contains post ID, names of the users who commented, and comments.
In this assignment, you will implement the necessary functions to run a complete social network platform using
the pre-defined classes. Your project should implement the following features:
1. Log in:
○ Prompt the user to enter their user ID. Check if the entered user ID exists in the vibenet users
dictionary. If the user ID is not found, display an error message. If found, proceed to the next
step.
○ Prompt the user to enter their password. Retrieve the corresponding User object and verifie if the
entered password matches the stored password. If the password is incorrect, display an error
message. If login is successful, allow the user to interact with the system.
2. Sign up:
○ Prompt the user to enter username and password and validate the password.
○ A valid password must:
i.Be at least 8 characters long.
ii.Contain at least one uppercase letter.
iii.Contain at least one lowercase letter.
iv.Contain at least one digit.
v.Contain at least one special character (e.g., @, #, $, %, etc.).
○ If the password does not meet these criteria, prompt the user to re-enter a valid password.
○ Generate a unique user_id and create a new User object and add the new user to the vibenet users
dictionary.
○ Print a success message and display the new user's profile.
○ Allow the new user to interact with the system.
3. Create Post:
○ Prompts the user to enter the content of the post.
○ If the content is empty, display an error message.
○ Generate a unique post_id and create a new Post object with the given user_id and content.
○ Add the post to the vibenet posts dictionary and associate it with the user’s posts dictionary.
4. View Profile:
○ Retrieve the User object corresponding to the logged-in user.
○ Calls appropriate method of the User class to show: User ID, username, number of followers,
and number of users they are following, all posts created by the user.
○ The user should be able to: Edit and delete a post only if the user has created any post
5. Edit Post:
○ Prompt the user to enter the post_id of the post they want to edit and verify if the post_id exists
and if the user has permission to modify it.
○ Display the current content of the post and prompt the user to enter new content.
○ If the new content is empty, display an error message.
6. Delete Post:
○ Prompt the user to enter the post_id of the post they want to delete and verify if the post_id exists
and if the user has permission to delete it.
○ Remove the post from vibenet posts and from the user’s posts dictionary.
7. Search Posts by Tag:
○ Prompt the user to enter a hashtag keyword without # symbol. If the tag is empty, display an
error message.
○ Search through vibenet posts to find posts containing the entered hashtag.
○ If no posts are found, display a message.
○ If posts are found, display them sorted by likes and comment count in descending order.
8. View Newsfeed:
○ Retrieve all posts and sorts them by: engagement score in descending order (likes * 0.5 +
comments * 1.0) and Date (newer posts first)
○ Display each post, including the engagement score.
○ After displaying the newsfeed, the user should have options to: like a post or comment on a post
9. Like a Post:
○ Prompt the user to enter a post_id. If the post_id exists, increment the like_count. If the post_id
is invalid, display a message.
10. Comment on a Post:
○ Prompt the user to enter a post_id. Check whether the post id valid.
○ If the post_id exists, prompt them to enter a comment.
○ Append the comment to the post’s comments list, increment comment count,
11. View Users:
○ Retrieve all users and sort them by the number of followers and the number of following
users in descending order and show them
12. Search Posts by Date:
○ Prompt the user to enter a start date and end date in YYYY-MM-DD format.
○ Use the appropriate method from the classes given to get the posts in that range
○ If posts are found, display them sorted by date (newest first).
Hints:
● Do not modify the vibenet.py file in any case.
● Keep in mind to use the appropriate methods of the classes. There are lots of functionalities already
implemented for you.
● Add the beginning of the program, call proper methods of VibeNet class to load data from the files.
● Utilize the can_modify method under Post class when needed.
● You can use ch.isalnum()to check whether ch is a symbol or not.
5. Grading Rubric
Computer Project #07 Scoring Summary
General Requirements:
(5 pts) Coding Standard
(12 pts) At least 12 function definitions
Implementation: 33 points total.
Test Case 0 and 1: Visible
Test Case 2 and 3: Hidden
More points are allocated to the hidden test. The visible tests serve as a self-check. To pass all
tests, you need to follow the complete instructions in the PDF.
Note:
1. hard coding an answer earns zero points for the whole project.
2. Use of any advanced data structures not covered in class earns zero points for the whole
project.
6. Sample Output
The outputs for Test 0 and Test 1 are in the output0.txt and output1.txt

热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图