Nat 5 – Our first program

Today in class we used TRACS to look at the program from last time, so we could better understand how it works and how the Python translator works.

  • A compiler changes all the source code (python) to machine (object) code. The machine code is then executed after all lines have been complied.
  • An interpreter changes one line of source (Python) code to Machine (object) code, this is then executed immediately.

The class was then set a new program to create.

Task

Write a program that takes in 3 numbers, calculates the total, then works out the change from a given amount.

Test data

2.99, 1.50, 3.00
10.00

Leave a Reply

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