Programming Terminology – Drag and Drop


To be a good carpenter, you need to be able to identify and select the right tools to complete your project. For instance, the main wood working tools used by carpenters are:

Chisel, Hand Saw, Hammer, Screwdriver, Hand Plane, Caliper, Level, Clamp, Circular Saw, Jigsaw, Orbital Sander, Palm Sander, Tape Measurer, Miter Gauge, Router, Band Saw, Power Drill, Drill Press, Grinder, etc.

It’s the same with programming. To be a good programmer, your need to be able to identify all the tools that are available to build a computer program. If you can name these tools, you will then be able to select the right tool when you need them!

When using procedural programming with a high level programming language like Python, the main tools of the programmer are:

    Sequencing,
    Iteration,
    Selection,
    Variables,
    Constants,
    Data Types (Integer, Float, String, Boolean) & casting values,
    Computing Operators (assignment operator, arithmetic operators, comparison operators, Boolean operators)
    Data Structures (e.g. lists and arrays)
    String manipulation techniques (incl. String concatenation)
    Subroutines (e.g. Procedures and Functions)
    Libraries (e.g. random library, time library, etc.)
    Etc.

Task 1: Drag and Drop

Complete the fill in the gaps activity below to label all the programming terminology used in this Python program:


Programming TerminologyOpen in New Window

Task 2: Python Coding

Code this program online using trinket.io.

Task 3: Returning the change!

Update the above code, so that, when the user overpays, the program returns the change. For instance, if your customer overpays by £14, the output of your code would be:

You overpaid by £14. Here is your change:
£10 banknote
£2 coin
£2 coin

unlock-access

Solution...

The solution for this challenge is available to full members!
Find out how to become a member:
➤ Members' Area

Did you like this challenge?

Click on a star to rate it!

Average rating 3 / 5. Vote count: 176

No votes so far! Be the first to rate this post.

As you found this challenge interesting...

Follow us on social media!