Lab 4 - Practicing with decisions

In this lab, you get to write a simple programs that involve using the Python decision statements.

I use simple Microcontrollers for teaching how to control machines in my assembly language class. These computer systems are cheap and a lot of fun to work with. Here is a links showing the devices I use:

Your job is to write a Python program to calculate the total cost of purchasing these boards from “Lady Ada” who runs Adafruit (You should look her up, she is an MIT graduate with a passion for things electronic).

Here is some data to use

  • Arduino unit cost:
    • 1-9: $29.95
    • 10-49: $26.96
  • Shipping costs:

    • for less than 20 parts
      • USPS Priority (7 days) $4.72
      • UPS Ground (5 days) $9.60
      • UPS Express (3 days) $12.84
      • UPS Next day $29.94
    • for 21 - 49 parts
      • UPS Ground (7 days) $10.94
      • USPS Priority (5 days) $17.50
      • UPS Express (3 day) $16.46
      • UPS next day $36.81

What your program should do

Your program should ask the user how many units they need, and the delivery time in days. It should calculate the total cost for the parts with shipping. (We will ignore the sales tax issue for this problem.

Your output should be clear enough to identify the following:

  • Cost of parts
  • Cost of shipping
  • Total of both

When is this due?

As usual, next Sunday.