CSIS 201 Assignments


Generally, work will be submitted electronically by:

Unless otherwise specified, programs will be submitted as source code (e.g., p1.py) and written assignments will be submitted in PDF format. For programs consisting of multiple files, programs will be submitted as a compressed archive (e.g., p8.zip or p8.tar.gz). No handwritten work will be accepted.

Ensure that you comply with the following for each file of your source code or PDF:

See hello.py for a trivial example of a program in the proper format.

New assignments are added as the semester progresses. Check back often.

Assigned Due Date Assignment
8/26 8/30 @
11:55 PM
Assignment: Algorithmic paper (20 points)
Write a one-page paper detailing the steps required to tie a shoe or button a dress shirt. Submit your PDF on the FoxTALE site above.
8/26 8/30 @
11:59 PM
Assignment: Ch 1 Reading (55 points)
Do the Chapter 1 Participation (orange) activities.
8/26 9/5 @
11:59 PM
Assignment: Ch 1 Coding (14 points)
Do the Chapter 1 Challenge (blue) activities.
8/26 9/6 @
11:59 PM
Assignment: Ch 2 Reading (94 points)
Do the Chapter 2 Participation (orange) activities.
8/31 9/7 @
11:55 PM
Program 1 (40 points)
Write a program that displays the following information:
  • Your name
  • Your address, with city, state, and zipcode
  • Your phone number
  • Your major
8/31 9/7 @
11:55 PM
Program 2 (40 points)
Write a program to determine and display the annual profit of a company (total sales * profit percentage). The user will input both total sales and annual profit percentage. The user will enter details in the following order:
  • Total sales (1 float)
  • Profit percentage (1 float, e.g., 0.35 to indicate 35%)
9/3 9/11 @
11:59 PM
Assignment: Ch 2 Coding (19 points)
Do the Chapter 2 Challenge (blue) activities.
9/3 9/13 @
11:59 PM
Assignment: Ch 3 Reading (66 points)
Do the Chapter 3 Participation (orange) activities.
9/17 9/17 Lab 1: Receipt lab (40 points)
Write a program that accepts three item names, along with corresponding prices, and displays a sales receipt. Use this example as a guideline for your receipt output. You may find Python's string format specification mini-language helpful for formatting your output using the str.format() method.
9/10 9/18 @
11:59 PM
Assignment: Ch 3 Coding (25 points)
Do the Chapter 3 Challenge (blue) activities.
9/7 9/19 @
11:55 PM
Program 3 (40 points)
A cookies recipe calls for the following ingredients:
  • 1.5 cups of sugar
  • 1 cup of butter
  • 2.75 cups of flour
The recipe produces 48 cookies with these ingredients. Write a program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient needed for the specified number of cookies. The user will enter the number of cookies desired (1 integer).
9/7 9/19 @
11:55 PM
Program 4 (40 points)
Write a program that asks the user for the number females and the number of males registered in a class. The program should then display the percentages of females and males in the class. The user will enter details in the following order:
  • Number of females (1 integer)
  • Number of males (1 integer)
Hint: Suppose there are 12 females and 8 males in a class. There are 20 students total in the class. The percentage of females can be calculated as 12/20 = 0.6, or 60%. The percentage of males can be calculated as 8/20 = 0.4, or 40%.
9/10 9/21 @
11:59 PM
Assignment: Ch 4 Reading (116 points)
Do the Chapter 4 Participation (orange) activities.
9/10 10/2 @
11:59 PM
Assignment: Ch 4 Coding (33 points)
Do the Chapter 4 Challenge (blue) activities.
9/25 10/11 @
11:55 PM
Program 5: Hot Dot Cookout Calculator (60 points)
Assume that hot dogs come in packages of 10, and hot dog buns come in packages of 8. Write a program that calculates the number of packages of hot dogs and the number of packages of hot dog buns needed for a cookout, with the minimum amount of leftovers. The program should display the following details, in the following order: The minimum number of packages of hot dogs required, the minimum number of packages of hot dogs buns required, the number of hot dogs that will be left over, and the number of hot dog buns that will be left over. The user will enter details in the following order:
  • Total attendance (1 integer)
  • Hot dogs per person (1 integer)
9/25 10/11 @
11:55 PM
Program 6: Change Maker Program (60 points)
Write a program that accepts a sales amount (in dollars) and an amount tendered (in dollars) and then displays to the screen the change (in dollars) along with only the correct denominations of money returned. Your output needs to be grammatically correct (e.g., "2 quarters", "1 quarter").

A sample run is listed below. The highlighted text indicates user input.

 Welcome to my Change Program
Enter the sales price (xx.xx): $3.46
Enter the amount tendered (xx.xx): $5.00

Your change is: $1.54
You will receive:
1 - Dollar Bill
2 - Quarters
4 - Pennies
Implementation notes:
  • You may be off by a penny due to floating point precision errors...don't worry about that for this program.
  • Using integer division or modular division on floats loses lots of grade points! Operators // and % may only be used on integers, regardless what Python actually allows.
  • You must use only these denominations when making change: penny, nickel, dime, quarter, one dollar bill, five dollar bill, ten dollar bill, twenty dollar bill, fifty dollar bill, and one hundred dollar bill.
9/25 10/8 @
11:59 PM
Assignment: Ch 5 Reading (65 points)
Do the Chapter 5 Participation (orange) activities.
9/25 10/16 @
11:59 PM
Assignment: Ch 5 Coding (18 points)
Do the Chapter 5 Challenge (blue) activities.
10/2 10/22 CodingBat 1: Logic-1 (50 points)
Complete any five (5) problems from the Logic-1 section on CodingBat. Ensure you have properly set the "Teacher Share" preference to report your progress to your instructor.
10/8 10/19 @
11:55 PM
Program 7: Budget Analysis (100 points)
Write a program that asks the user to enter the amount that they budgeted for the month. A loop should then prompt the user to enter there expenses, one at a time and to enter 0 to quit. When the loop finishes, the program should display the the amount of budget left. (a negative number indicates the user is over budget and a positive number indicates the user is under budget) The program should prompt the user to run the program again. The user will enter details in the following order:
  • Total amount budgeted (1 float)
  • Expense amounts (unknown number of floats, 0 to quit)
  • "Run again?" response (1 string, Y for "yes, run again" and N for "no, quit")
Notes:
  • If Y is entered to run again, the same input types are entered for each additional run.
  • You must validate inputs and reject negative monetary amounts. Make the user re-enter a valid amount.
10/8 10/19 @
11:55 PM
Program 8: Distance Traveled (100 points)
The distance a vehicle travels can be calculated as follows: distance = speed x time For example, if a train travels 40 miles per hour for three hours, the distance traveled is 120 miles. Write a program that asks the user for the speed of a vehicle (in miles per hour) and the number hours it has traveled. It should then use a loop to display the distance the vehicle has traveled for each hour of that time period. For example: The highlighted text indicates user input.

 Welcome to my Distance Calculator
Enter the vehicle speed: 40
Enter the hours traveled: 3

Hour Distance
----------------------
1 40
2 80
3 120
Do you want to run again? (Y/N): N
The program will prompt the user to run the program again after each run. The user will enter details in the following order:
  • Vehicle speed in MPH (1 integer)
  • Number of whole hours traveled (1 integer)
  • "Run again?" response (1 string, Y for "yes, run again" and N for "no, quit")
Notes:
  • If Y is entered to run again, the same input types are entered for each additional run.
  • You must validate inputs and reject negative speed and negative hours traveled. Require user to re-enter any bad input.
10/8 10/22 @
11:59 PM
Assignment: Ch 6 Reading (58 points)
Do the Chapter 6 Participation (orange) activities.
10/8 10/30 @
11:59 PM
Assignment: Ch 6 Coding (20 points)
Do the Chapter 6 Challenge (blue) activities.
10/18 11/5 CodingBat 2: Logic-1 and Logic-2 (50 points)
Complete two additional problems from the Logic-1 section on CodingBat giving you a total of 7 completed. Complete three problems from the Logic-2 section on CodingBat. Ensure you have properly set the "Teacher Share" preference to report your progress to your instructor.
10/18 11/12 @
11:55 PM
Program 9: Rock, Paper, Scissors (200 points)
Write a program to allow the user to play Rock, Paper, Scissors against the computer. The program will be menu driven (see details below). The user can continue to play the game over and over by choosing to play the game in the menu. A game consists of a single battle: win, lose, or tie. For a single battle the user makes their move and then the computer move is displayed followed by a description of who won that battle. Do not break a tie.

Once the user chooses to quit, the program then displays the win/loss/tie record for all the games just played. For example, if I chose to play 5 times and actually won 2, lost 2, and tied once out of those 5, then the final display as I chose to quit would be something like:

 Human: 2, Computer: 2, Tie: 1 

The user will enter the details in the following order during gameplay:

  • Menu choice (1 integer, 1 to play a game, 2 to quit)
  • Player's move (1 string, Rock, Paper, or Scissors)
Notes:
  • From now on, you must modularize (i.e., separate into functions) your programs. Be sure to include block comments for each function, including your main() function.
  • From now on, you must now trap for everything that is not valid data, including incorrect data types.
  • Generate computer moves using functions from Python's random module.
10/22 11/1 @
11:59 PM
Assignment: Ch 7 Reading (18 points)
Do the Chapter 7 Participation (orange) activities.
10/29 11/12 @
11:59 PM
Assignment: Ch 8 Reading (79 points)
Do the Chapter 8 Participation (orange) activities.
10/29 11/20 @
11:59 PM
Assignment: Ch 8 Coding (16 points)
Do the Chapter 8 Challenge (blue) activities.
11/1 11/19 CodingBat 3: List-1 and List-2 (50 points)
Complete any three (3) problems from the List-1 section and any two (2) problems from the List-2 section on CodingBat. Ensure you have properly set the "Teacher Share" preference to report your progress to your instructor.
11/12 11/26 @
11:59 PM
Assignment: Ch 9 Reading (33 points)
Do the Chapter 9 Participation (orange) activities.
11/12 12/4 @
11:59 PM
Assignment: Ch 9 Coding (10 points)
Do the Chapter 9 Challenge (blue) activities.
11/12 12/5 @
11:55 PM
Program 10: Casting of Lots (250 points)
Write a program to allow the user to play "the casting of lots" against the computer. The program should be menu driven. It should have three choices:

 1 - Field Bet
2 - Pass Bet
3 - Quit
The program will load from a file (talents.txt) the number of talents the user has to play with. Upon quitting the program, the program should write the current amount of talents so the user can continue the game the next time the program is started.

The game requires two pieces of information in order to play: 1) the type of wager, and 2) the amount of talents to wager. The program should stop when the user chooses to quit (i.e., menu choice 3), or when the user has no more talents to wager. In the event of losing all the talents and being forced to quit, the user should be given 100 talents on the next run of the program.

The following is the structure of the game; everything listed below refers to the very first cast of lots, unless otherwise specified:

Field Bet:

  • 2, 12: Win double what you bet
  • 3, 4, 9, 10, 11: Win even talents
  • 5, 6, 7, 8: Lose your bet

Pass Bet:

  • 7, 11: Win even talents
  • 2, 12: Lose your bet
  • 3, 4, 5, 6, 8, 9, 10: This cast becomes point.
    • Once a cast becomes point, the only numbers that mean anything are 7, 11, and point. You will continue to cast again and again until one of the following come up, with corresponding outcome:
      • 7, 11: Lose your bet
      • point: You win even talents

A sample run is listed below. The highlighted text indicates user input.

 Welcome to the Lots Game
Talents you have to play with: 100

1 - Field Bet
2 - Pass Bet
3 - Quit
Choice --------------------------- 1
How much do you wish to wager? --- 10
The LOTS CAST is ----------------- 2
You won double your bet.
You now have --------------------- 120

1 - Field Bet
2 - Pass Bet
3 - Quit
Choice --------------------------- 2
How much do you wish to wager? --- 10
The LOTS CAST is ----------------- 6
The LOTS CAST is ----------------- 5
The LOTS CAST is ----------------- 2
The LOTS CAST is ----------------- 7
You lost your bet.
You now have --------------------- 110

1 - Field Bet
2 - Pass Bet
3 - Quit
Choice --------------------------- 3
12/4 12/11 Final Exam Part I (30 exam points)
Write a complete program to let the user play a "guess a number between 1 and N" guessing game with the computer. You may define your own starting boundaries (e.g., 1 and 100); you may also ask the user to enter an upper bound if you like. If the user does not guess correctly then the computer will update the boundaries using the last guess as one of the new boundaries.

When the user finally guesses the number, the computer should acknowledge this and also display the number of valid guesses that the user made. When the user finally chooses not to play anymore, the program should print out a message with the best round played.

Below you will find an example run. Note that you must print out the correct answer each time before the user starts making guesses, so that I can verify that the program is correctly winnowing down the search space. Failure to do so results in zero "functions correctly" points, and is guaranteed to drag some not-insignificant number of elegance points with it.

Finally, this is officially part of your final exam. This is individual effort—no help from anyone beyond the course instructor(s) and lab assistants. We will answer clarifying questions, point to the general location of errors, etc, but little else.

 Welcome to the Guessing Game!

(answer is 86)
Guess a number between 1 and 100: 42
Too low!
Guess a number between 42 and 100: 7
Your guess must be between 42 and 100.
Guess a number between 42 and 100: Bob
Your guess must be a number.
Guess a number between 42 and 100: 75
Too low!
Guess a number between 75 and 100: 90
Too high!
Guess a number between 75 and 90: 83
Too low!
Guess a number between 83 and 90: 86
You guessed it!
It only took you 5 guesses.
Play again? (Y/N): Y

(answer is 37)
Guess a number between 1 and 100: 50
Too high!
Guess a number between 1 and 50: 25
Too low!
Guess a number between 25 and 50: 37
You guessed it!
It only took you 3 guesses.
Play again? (Y/N) N

Thanks for playing!
Your best round was 3 guesses.
12/4 Special Topics
MIT App Inventor (assets)
12/6 Special Topics
Construct 3 (assets, tutorial, saved project)
North American plant data (matplotlib tutorials)

This page was last modified on 2018-11-13 at 06:52:05.

George Fox University · 414 N Meridian St · Newberg, Oregon 97132 · 503-538-8383
Copyright © 2015–2018 George Fox University. All rights reserved.
Your IP: 52.91.185.49