Assignment 2
Conditions and Simple Loops
Submit before 11:30 PM Friday September 22

Overview

You will write three simple programs involving lists, conditions and simple loops.

Python Programs

Write and test Python programs that do the following:

  1. Random story: write a Python program so that it inputs two prompts (e.g. a name and an action) from the user and randomly selects a word or phrase from a hand-coded List (e.g. a list of cities) to produce a short story.
  2. Include the total cost calculator for shipping and taxes that was optional for lab 2 (second Python program) but is now required for this assignment.
  3. Write a program that inputs the number of credit hours for a particular term and produces the tuition cost for the quarter. Assume the following costs for tuition (based on the DePaul Tuition Rates for 2023-2024):
    • Tuition for 1 - 11 credits is the number of credit hours times 758.
    • Tuition for any credits between 12 and 18 is a flat rate of 14555 dollars.
    • Tuition for any credits over 18 is the flat rate plus the credits beyond 18 times 758.
  4. Automated Kumbaya: Write a program that reads in a list (using input example from class) of activities (e.g. singing, praying, crying) and uses them to form printed stanzas of Kumbaya. Feel free to adapt (and even simplify) the stanzas to your own preferences, but each stanza should have repeated reference to each activity. For full credit, implement your song-producing program so that it has a loop within a loop.

    Below is one example of a working program:

    Enter in a list of activities (e.g. ['crying', 'smiling']): ['crying', 'smiling', 'dancing'] Someone is crying, Kumbaya! Someone is crying, Kumbaya! Someone is crying, Kumbaya! Oh, Kumbaya!! Someone is smiling, Kumbaya! Someone is smiling, Kumbaya! Someone is smiling, Kumbaya! Oh, Kumbaya!! Someone is dancing, Kumbaya! Someone is dancing, Kumbaya! Someone is dancing, Kumbaya! Oh, Kumbaya!! >>>

Deliverables

Create a text file called assn2.txt that contains the following:

  1. A statement that summarizes your completion of the assignment. It should contain the following information:
    • Any help or resources that you used in completing the assignment.
    • A summary of your experience possibly including your approach, difficulties and time you spent.
  2. For each of your Python scripts:
    1. A listing of the script
    2. Running examples that demonstrate that your script works correctly

Submit your assn2.txt file to D2L.