This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 10: Applied problem solving

Applied problem solving

face Josiah Wang

Now, it is time for you to apply what you have learnt so far to write a program.

You will now be presented with some applied problems to practise your programming. You will need to write a Python program to solve these problems.

If you recall from Lesson 1:

  • Programming \ne coding
  • Programming \supset coding

Instead, programming involves more than just coding. You should

  1. understand and formulate the problem;
  2. design an algorithm to solve the problem;
  3. implement the algorithm

Remember, do not jump straight into coding!

Try to understand the problem first, then devise a solution or algorithm (preferably with a pen/pencil on a piece of paper). Then, you can implement your solution in Python.

Also, try typing out the program yourself. Physically typing out your code is different from simply ‘visualising’ the solution in your mind.

You should also test out your program to make sure it works for different use cases, especially edge cases.

The link to the sample solutions for this exercise can be found somewhere on the main Guided Learning Materials page (you will have to find it yourself! 😈) Remember that there are many ways to solve the same problem. I’ve provided these just for you to compare your solution to some possible solutions.

I will trust that you will attempt the questions yourself first 👼 You will remember better when you do the exercises yourself! You will not improve your programming skills if you just look at my sample solutions and think you understand how to solve it.