, MCS-177: Intro to CS I Project 8 (Spring 2017)

MCS-177 Project 8: Facebook part B (Spring 2017)

Start: Tuesday, May 2; Due Date: Tuesday, May 9

(Will be accepted until Thursday, May 11 at 10pm - no token needed)

Overview

In this project, you will experiment with building your own Python classes. This project is the second half of the Facebook activity, where the main goal is for you to build classes to represent a text-version of Facebook.

If you have submitted a working version of part A of the individual Facebook activity (project 7), you are welcome to work on this project with a partner. Otherwise, please finish project 7 first and find a partner who is in a similar situation.

Note: 90% of the work must be done as a pair-programming activity (as opposed to dividing up parts of the project). You must not put the name of a partner on the project if the partner has not done at least 90% of the work.

Please tell the lab instructor your partner's name (or whether you are working alone). If you are submitting a pair project, please only submit one copy of the code with both names and email addresses written in each of the Python files as a comment at the top of the files.

Please remember to write down all individuals and sources that you discuss this project with. If you use a different textbook or other written resources, please include the textbook's author/title and URLs.

Warm up exercises (prior to attempting the project)

  • Complete Project 7: Facebook Part A

    Example

    Here is an example of how all the classes come together to make our Facebook work.

    >>> TextFacebook = Facebook()
    >>> TextFacebook.registerUser('Bob', 'bob@gmail.com')
    >>> TextFacebook.registerUser('Alice', 'alice@gac.edu')
    >>> TextFacebook.registerUser('Charles', 'charlie@hotmail.com')
    >>> TextFacebook.login('Bob')
    >>> TextFacebook.addFriend('Alice')
    >>> TextFacebook.postStatus('is working on Project 10!')
    >>> TextFacebook.viewStatus()
    (0) Bob is working on Project 10!
    >>> TextFacebook.logout()
    >>> TextFacebook.login('Charles')
    >>> TextFacebook.addFriend('Alice')
    >>> TextFacebook.postStatus('is going to watch Star Trek Into Darkness.')
    >>> TextFacebook.viewStatus()
    (1) Charles is going to watch Star Trek Into Darkness.
    >>> TextFacebook.logout()
    >>> TextFacebook.login('Alice')
    >>> TextFacebook.viewProfile()
    Alice (alice@gac.edu)
    Friends: Bob and Charles
    >>> TextFacebook.viewStatus()
    (0) Bob is working on Project 10!
    (1) Charles is going to watch Star Trek Into Darkness.
    >>> TextFacebook.toggleLikeStatus(1)
    >>> TextFacebook.viewStatus()
    (0) Bob is working on Project 10!
    (1) Charles is going to watch Star Trek Into Darkness.
    Alice likes this.
    >>> TextFacebook.commentOnStatus(0, 'Poor you... Have a cookie!')
    >>> TextFacebook.viewStatus()
    (0) Bob is working on Project 10!
    Alice: Poor you... Have a cookie!
    (1) Charles is going to watch Star Trek Into Darkness.
    Alice likes this.
    >>> TextFacebook.logout()
    >>> TextFacebook.login('Bob')
    >>> TextFacebook.viewStatus()
    (0) Bob is working on Project 10!
    Alice: Poor you... Have a cookie!
    >>> TextFacebook.commentOnStatus(0, "It's all right. The project is a lot of fun!")
    >>> TextFacebook.postStatus("finished working on Project 10! Woohoo!")
    >>> TextFacebook.logout()
    >>> TextFacebook.login('Alice')
    >>> TextFacebook.viewStatus()
    (0) Bob is working on Project 10!
    Alice: Poor you... Have a cookie!
    Bob: It's all right. The project is a lot of fun!
    (1) Charles is going to watch Star Trek Into Darkness.
    Alice likes this.
    (2) Bob finished working on Project 10! Woohoo!
    

    Task 1: Comment class

    Put a copy of the comment.py (notice the all-lowercase) file from Project 7 in your working directory.

    Task 2: Status class

    Put a copy of the status.py (notice the all-lowercase) file from Project 7 in your working directory.

    Task 3: User class

    Implement the User class (notice the capital 'U') in user.py (notice the all-lowercase)such that:

  • Task 4: Facebook class

    Implement the Facebook class (notice the capital 'F') in facebook.py file (notice the all-lowercase) such that:

    Bonus learning A (optional)

    Students in past Intro CS 1 classes learned about class inheritance. However, in order to fit in other topics, we decided to stop covering it. If you wish to learn about class inheritance, read the textbook Chapter 12: pages 393-421. You can also look up only python3 object-oriented programming tutorials which discuss inheritance, such as this one: python3_inheritance. This concept would be especially useful if you plan to take Intro CS 2 or other CS classes.

    Bonus learning B (optional)

  • Read about how to animate the solar system by first implementing a planet class and a sun class and using physics and the turtle module (pages 352-364 Sec 10.6.1 in the textbook 2nd edition). The code that you can copy and paste for animating a solar system (not our solar system) is available here: Astronomy Lab. Modify them to create different animations (for example, see Listing 10.15 page 364).
  • Implement a graphical simulation (with turtle) for bear population, taking into account fish and plants availability. Follow the programs written in Chapter 11: pages 374- 390.
  • Create an Etch-a-Sketch drawing program or an alien invader video game. You can copy the programs written in Chapter 13: pages 425-440 (Etch-a-Sketch) pages 441-450 (alien invader)
  • Submitting your work

    Submit your code using Moodle; click on the following link for instructions on submitting code using Moodle. For this project, you will need to submit the following files:

    Grading Rubric

    If you submit your project early, you will get an early feedback on of your work.

    The grader will test your program against various input values. Check your work against the grading rubric project8gradesheet.pdf which the grader will use when grading your lab.