Assignment 1

This assignment has 2 parts:

  • Part 1: A written investigation to start us off!
  • Part 2: Some coding in Python!


Part 1: Discovering CS (5 Marks)


To get us started, assignment 1 includes a little discovery about the fields of Computing Science here at SFU. Please complete ONE of the following 2 options:

  1. Look at the list of SFU Computing Science faculty. Choose 2 professors and look at their homepage or search up articles written by/about them. Write 1 paragraph for each professor, in your own words, describing what they work on within computing science and examples of applications resulting from their research. Please include your sources.

    OR

  2. Choose 2 of your favourite computer program or website (video game, photo-editor, web browser, music player, social media site, search engine, ...). For each, look up one algorithms that would be used in that style of program. Read up a little on the algorithms and write 1 paragraph about each algorithm. Please include your sources.

For example, start with a search like "What algorithms do video games use to know the best path for a creature to follow to get somewhere?" or "What algorithms do photo editor applications use to remove noise from images?".

You may not use generative AI systems (like ChatGPT) for generating your content. However, you are welcome to use non-academic sources like Wikipedia, or video game programmer's blogs. This is to spark interest, not write publishable papers! You may not copy-and-paste content from the web: you must write the text yourself!

  • Your paragraph is expect to be more factual than opinion based. You may mention your opinion briefly, but the bulk of the work should be focused on a factual explanation.
  • You must cite your sources: in your paragraphs indicate where different facts came from by citing the source. Any reasonable and clear citation style is fine.
  • Expected length 300-500 words (total, for both paragraphs combined).


Part 2: Charity Services Chatbot in Python (15 Marks)


Imagine that a (fictitious) charity contacts you. They offer a number of services to clients, but some people have trouble finding the right services to make use of. The charity is asking you to create a charity services chatbot written in Python. It will ask a user what they need help with, and then direct the user to an appropriate service offered by the charity.

Your program must search the user's input for some specific words which likely indicate what they need help with. You must use the `in` keyword to check for a specific word inside the user's text (case insensitive). For example, at a hospital you may look for words like "broken", "sick", "medication", or "baby" to direct the user to different services.

For at least one of the services your charity offers, also ask the user a yes/no question for further clarification of their needs. For example, "Are there any minors involved?", or "Do you need directions?" or "Would you like to have a phone call instead?"

Your prompt for yes/no questions should look similar to: "Enter [YES/no]: ". For yes, the user could type YES (any case), Y (any case), or just pressing enter (""). For no, the user could type NO (any case), or N (any case). Your program must ignore punctuation at the start and end of the user's response (including commas, periods, exclamation marks, spaces, and question marks). If the user has entered anything which is not registered as yes or no, then have the bot say that it did not understand.  The bot does not have to retry asking the user to answering the yes/no question; it can just continue on with its logic.

If the program finds none of the specific words it is looking for in the user's input then display to the user the name of a randomly selected employee whom the user should talk to. The program must randomly choose between at least 3 employee names.

Finally, your chatbot should loop through is entire operation 3 times (thus seeming to service three different users).

Specific Requirements

Your chatbot must use...

  • a filename of services_chatbot.py
  • at least one if, at least one elif, and at least one else.
  • at least one nested if statement.
  • at least one or.
  • at least one .strip(), and at least one .lower() (or .upper()).
  • at least one loop (likely for)
  • the random package to select a random employee's name.

The chatbot should start when you click Run.

Design your algorithm in English comments first, then translate it to Python code. Leave the comments in the code. Test as you go!

Note: Add some personality! You are welcome (and encouraged) to expand on this assignment for enhancing your understanding, as long as it meets the minimum requirements above. There are no extra points for this, but it will help you for the tests!

Readability Guidelines

  • Ensure that there is a comment at the top of the file with
    • Description of the file
    • Your name & date
  • All import statements should be placed at the top of the file, immediately after the header
  • Modules should only be included once per file
  • Well-named variables (describes their purpose)
  • Each line of code should be less than 100 characters


Submission


Submit these files directly to CourSys (don't ZIP them):

  1. Part 1’s paragraphs as a .PDF file.
  2. services_chatbot.py

Submission Notes

  • You can create a PDF from inside most word processors.
  • Submit all files at the same time. You can re-submit any number of times; only your last submission will be marked. If changing only one of your files, please still submit all files together. If you only submit one file then CourSys will not show us the other files when we mark.
  • All submissions will be compared for unexplainable similarities. We expect submissions will be somewhat similar for this assignment but do your own original work; we are checking!
  • Do not email/give your code to another student. Do not accept code from another student. Do not post your code online.

Troubleshooting Submission Problem

Here are some things to look at if you have challenges submitting:

  1. When submitting your source code to CourSys, it will enforce that the files have the correct names. Ensure your file names are exactly as expected, and not services-chatbot.py (- instead of _) or services_chabtot.py (typo).
  2. Ensure your file names are the correct case (lower case), and not Services_chatbot.py or services_chatbot.PY.
  3. Ensure your files have a .py file extension.
  4. Ensure your files do not have anything extra in their name, such as "chatbot.py.source". Your computer may hide file extensions by default, so search the web for "Show file extensions in ___" (fill in the blank with your OS) for directions.
  5. Ensure that you have named the python file as required, as opposed to having named the folder with that name.
  6. After submitting, you can verify if any files were submitted by viewing the assignment page on CourSys. It should allow you to view/download your submission.

Marking Notes

  • Code that does not run (i.e., crashes or produces an error stopping the program) then it will get a mark of 0.
  • To ensure your code works try to finish early so you can get help from TAs if needed! It is better to submit code that works perfectly but doesn't contain all the features, than one that has all the features (potentially) but crashes.
  • Each line of your code should NOT exceed 100 characters. This is to help you develop a habit of good code formatting.
    • In most cases you can break long code into separate steps, and some components that span multiple lines.
    • You could also use intermediate variables to store parts of long messages to be printed (more situations will be seen as the course advances).
    • If you are using offline IDEs like VS Code or IDLE, you can look at the bottom of the editor which often tells you how many characters you have typed in a line (as COL's).
    • If you are using Replit, first go to Settings on the left panel and set "Wrapping" to "none". Then use this sentence as a guide:
      # This line has exactly 100 characters (including the period), use it to keep each line under limit.