Hey! Welcome to my blog for Fusion IX.

Fusion is a STEM based cohort offered exclusively to Grade 10 students at St. George’s School.

Assignment #3 – Coding

This is my third and final mini-assignment out of the 3 Fusion self-paced assignments. Previously, I made a 3D model of a birdhouse and an Arduino-controlled piano keyboard.

For this particular coding assignment, I must demonstrate my understanding of these skills through this blog post:

  1. Flowcharting – there are standard practices of documenting the flow of your code.  We are less concerned here with proper adherence to conventions than we are that you are building the practice of writing out your plan before you start coding.
  2. Define and use variables
  3. Use of conditional statements (if-then, for loops, etc)
  4. Definition of use of functions
  5. User-centred design – does your program have a user interface that is friendly and easy to navigate (not necessarily a GUI)
  6. Thorough code commenting

This project must be completed through Python, which I already have some experience with from the Robotics 8 and 9 courses I took. After some brainstorming, I decided to make a simple to-do list program, since I rely on one myself in real life to keep things organized and done, so I thought it would be fun to make my own. I found various tutorials and articles explaining how to create a basic reminders program, and I added my own twists and modifications to their examples.

·

You can try out my finished custom To-Do List program and see all code commenting here:

https://replit.com/@timdai2009/To-Do-List-by-Tim

·

Skill 1: Flowcharting

I started my project by creating a flowchart of how my program would function. You can view my complete flowchart here:

https://www.figma.com/board/jvV5E1YO42WmEKLsuYRf8a/Untitled?node-id=0-1&t=QNX1Em3LgmYorsKh-1

·

Skill 2: Variables

Python variables are just containers used to store data. In my program specifically, many variables are used to store the user’s existing tasks, task categories, and other inputs/outputs.

Here’s an example of variables being used in my code:

The variable “task_name” holds the user’s input on what to name a task. The variables “category_choice” and “category_name” determine which category the task will belong to. After a new task has been created through this function, the task is added to the task list.

There are two global variables (variables created outside of a function) that are used throughout my code: List and Dictionary. Lists are essentially a storage space for many values at the same time. You can have as many values as you want, or even none at all. They are very flexible to work with and are used in most codes that require storing user input. Dictionaries are similar to lists but access values through a key instead of an index.

·

Skill 3: Conditional Statements

Conditional statements are a fundamental part of any coding language. They allow the code to respond based on user input. Throughout my to-do list program, if, elif, and else conditional statements are used to decide what options to show the user next.

Here’s an example of conditional statements being used in my code:

This code is found whenever the program starts up, and it decides where to direct the user next. The code is basically saying, if the user types in the number x, they will be directed to the next menu or x function will start up.

·

Skill 4: Functions

Functions break down programs into smaller, more manageable pieces. If an action is going to be repeated in a code, functions are useful because the programmer doesn’t have to type the same code over and over again. It helps avoid redundancy and keeps things organized. Each function handles a specific task.

Functions are used thoroughly throughout my program. Here’s an example:

Here, the function “create_task” is being created. This function creates a new task and assigns it to a category. After creating a new task, it returns the updated tasks list.

·

Skill 5: UI Design

The user interface of my to-do list program is a simple text-based layout. I use print statement that show text on the user’s screen, with numbers corresponding to potential actions that can be performed next.

As an example, this is what the user sees when the program starts up:

As an addition, previous options and the user’s past responses get deleted when the code proceeds to the next stage through a clear_screen function. All it does is clear the previous output and make the layout cleaner when moving on to the next step.

·

Skill 6: Code Commenting

Throughout the code, I’ve added snippets of texts next to lines of code explaining things like the purpose of a function or the function of a conditional statement, which makes the code overall easier to understand for people who might not be as familiar with Python. You can see all comments in my complete code (link at the top of this page).

·


Comments

One response to “Assignment #3 – Coding”

  1. mcrompton Avatar
    mcrompton

    Excellent work, Tim. I like that you’ve taken on a practical task and used it to address the needs of the assignment. You’re explanation of the various coding concepts is spot on and your code runs fairly well. The flowchart does a decent job of explaining the complex decision making tree that you have designed in your program. Good job all ’round!

Leave a Reply

Your email address will not be published. Required fields are marked *