Your instructor may assign one or more of the following problems. For the homeworks, you are only required to do those that are explicitly assigned via Moodle.

Submit your work as you did for lab01, being sure to save your work in a folder called homework02

  1. Begin by creating a new folder named homework02 and then create a file makeChange.py. The general idea is to write a Python program that prompts for and receives from the user two values: a charged amount (the cost), and an amount paid. The program should then calculate and tell the user how to make appropriate change using the minimum number of bills of size 20, 10, 5, and 1. A few simplifications: A few sample interactions are shown below.
    ========================================================
    Please enter the charged amount for the transaction: 42
    Please enter the amount paid: 68
    Change is $26: 1 20(s), 0 10(s), 1 5(s) and 1 1(s)
    ========================================================
    Please enter the charged amount for the transaction: 26
    Please enter the amount paid: 60
    Change is $34: 1 20(s), 1 10(s), 0 5(s) and 4 1(s)
    ========================================================
    Please enter the charged amount for the transaction: 1
    Please enter the amount paid: 100
    Change is $99: 4 20(s), 1 10(s), 1 5(s) and 4 1(s)
    ========================================================
    			
  2. Begin by creating a new folder named homework02 and then create a file flag.py .

    Write a turtle-graphics program that draws a regulation Japanese flag, as shown to the right. For the official dimensions, see Japanese flag.

    The program should implement a model of the flag that scales to any size, as demonstrated by the two separate runs of the program shown here, based upon user input of the unit size for the flag. Note that each of these two runs read a value from the user and then drew the flag (once) along with the specified scale factor. You will need use new turtle commands for color and filling, which you’ll find documented in Python’s Turtle graphics reference documentation under “Color control” and “Filling”.

    Optional – As an alternative, you can create a flag of your choice, based either on a flag for an existing country (e.g., France or the Netherlands) or a flag of your own design (e.g., for your own island nation!).

    Honors students: Choose a flag that is relatively interesting -- not one of those really easy ones, like France or Belgium. (But, don't pick one that is too crazy complicated either.) Research the exact colors used in the flag and use those colors. Good choices include the flags of Georgia, Ghana, Greece, or Guyana, but there are many good choices.

Checking In

We will grade this assignment according to the following criteria: