Code Monkey home page Code Monkey logo

wad-s-up-cs50p-final-project-'s Introduction

CS50P Final project: Wad's Up

Alt text

Wad's Up helps tourists and day-trippers to determine which Dutch Wadden Island best matches their preferences.

Video Demo

Description

The Dutch Wadden Islands are beautiful and very popular. It is difficult for tourists and day trippers to choose which island they want to visit. Wad's Up assists them with this. Wad's Up will ask the user about their preferences regarding 3 characteristics of the islands (car-free, cycling network and ferry price). The preferences will be scored with a 5-point Likert scale. In this way the most suitable island for the user can be determined. If multiple islands have the same score, the winning island will be determined randomly. This is to prevent choice overload (for the user). Once the winning island has been determined, some statistics are shown and the winning island is returned to the user. Cowsay is used here so that some ASCII art is created. And a video starts about the winning island.

Project Files

Below a list of the different files that are part of the project. For the first two files a list of the functions is given. A short description is given of each function.

project.py

  • main(): starting point of execution of Wad's Up
  • def check(answer, name): checks if user is interested in visiting a Dutch Wadden islands
  • def user_input(): collects user input regarding their preferences
  • def preferences(no_cars, ferry, cycle_network): calculates the score on a Likert scale and updates dictionary where the scores are kept
  • def determine_winner(islands): determines winner. If multiple winners, randomly chooses a winner
  • def stats(islands): converts dictionary in pandas DataFrame and calculates mean and median
  • def your_destiny(name, island): returns winner to user
  • def countdown(t): counts down to zero after which the YouTube video about winning island is started'
  • def youtube(island_url): starts video of winning island

test_project.py

  • def test_check_yes(): tests user input 'yes' and 'YEs'
  • def test_check_no(): tests user input 'n'
  • def test_user_input(): tests storing user input in a list
  • def test_preferences(): tests if user input calculates the right score
  • def test_your_destiny(): prints winning island using cowsay
  • def test_your_destiny_wrong_island(): tests input 'wrong' island
  • def test_determine_winner_one_winner(): tests one winner
  • def test_determine_winner_multiple_winner(): tests if winner is in list of islands with the same score
  • def test_stats(): Testing if pandas dataframe is created, mean and median
  • def test_countdown(): Function tests if "None" is returned

requirements.txt

Package         Version
-------         -------
colorama        0.4.4
cowsay          6.1
mypy            1.7.0
pandas          2.1.3
pytest          7.4.3
pytube          15.0.0

Project style

PEP 8 and PEP 257 (Docstring Conventions) provide code conventions. This can be deviated from if there is good reason for doing so. The most important thing is monitoring consistency within a project and a module. The aim at Wad's Up has been to write readable and consistent code that follows the conventions laid down in PEP 8 and PEP 257. To check this, the following programs were used::

Design decisions

Likert questions were chosen to measure the user's preferences. For the Likert questions, users have 5 answer options. This allows the score to be measured more accurately than with yes/no questions.

Pylint E1101: Module 'cowsay' has no 'tux' member (no-member) was disabled in "def your_destiny(name, island)" because it gives a false positive: [pylint-dev/pylint#3684]

User instructions

  • Open Visual Studio Code or another IDE
  • Place the files "project.py", "test_project.py" and "requirement.txt" in the same top-level root directory (folder)
  • install the folowing packages: cowsay, mypy 1.7.0, pandas, pytube and types-colorama
  • excecute project.py with "python project.py"
  • give user input when asked
  • when finished book the ferry to your favorite island🙂

wad-s-up-cs50p-final-project-'s People

Contributors

sikkepitje avatar tonnocramer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.