Docsity

Programming HNC Unit 1: Understanding Algorithms and Problem Solving - Prof. Fathima, Slides of Programming Languages

Partial preview of the text

Download Programming HNC Unit 1: Understanding Algorithms and Problem Solving - Prof. Fathima and more Slides Programming Languages in PDF only on Docsity!

Unit 1 -

Programmi

ng

HNC

Important

Details

  • (^) Core Unit
  • (^) Mandatory
  • (^) 2 Assignments Hand out Hand in Final Grade Assignment 1

Assignment 2

Assignment Submission - Guide

  • (^) There are three assessment/grading criteria
    • (^) Pass
    • (^) Merit
    • (^) Distinction
  • (^) Only one submission per assignment
  • (^) Draft submission before deadline to receive feedback

Objectives

  • (^) To describe the steps involved in problem solving
  • (^) To describe the importance of algorithms
  • (^) To apply algorithms to real-life problems
  • (^) To identify what makes a good algorithm

Same

plan,

differen

t details

  • (^) Pizza Restaurant
    • (^) Pizza Express v Pizza Hut
    • (^) Dine in v Takeaway
  • (^) Frozen
    • (^) buy one with toppings
    • (^) add your own toppings
  • (^) Make your own
    • (^) different recipes for base

Takeaways

  • (^) There are many ways to achieve a task
  • (^) Trade-off between advantages and disadvantages of each
  • (^) What is best? - Depends on the situation
  • (^) Given a plan, still different ways to do it
  • (^) Programming is about devising plans โ€“ Problem Solving

Understanding a programming problem

  • (^) For the programming exercises,
    • (^) Do you understand what you are required to do
    • (^) Do you understand the programming constructs you will

need to use

  • (^) (if not, make sure you understand them before you start)
  • (^) Do not start to write a program until you have understood

the problem

DISCUSS (On Teams)

  • (^) What did you go to get ready for school this morning?

Algorithm

  • (^) A plan for solving a problem by following a sequence of rules is

called an algorithm.

  • (^) An algorithm should be (at least)
    • (^) Complete (cover all the parts of problem)
    • (^) Unambiguous (no doubt about what it does)
    • (^) Deterministic (only 1 possible result)
    • (^) Finite (it should finish)

Why do we need algorithm?

  • (^) In problem solving, a big part of computer programming is knowing how to formulate an algorithm.
  • (^) Computer algorithms play a big role in how social media works: which posts show up, which ads are seen, and so on.
  • (^) Google's programmers use algorithms to optimise searches, predict what users are going to type, and more.