CSIS 201 Assignments


Generally, work will be submitted electronically by:

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

circle.py is an example of a properly formatted program that defineds functions

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

Weekly

zyBooks.com
Check zyBooks throughout the semester for ongoing reading and coding assignments. Typically a reading assignment is due on Sundays and a coding challenge assignment is due on Fridays.

Due 9/17 @
11:55 PM

Program 1: Name (40 points)
Use skills from chapters 1 - 2.
Write a program that displays the following information:

  • Your name
  • Your major
  • Something interesting about yourself

Due 9/23 @
11:55 PM

Program 2: Sales (40 points)
Use skills from chapters 1 - 2.
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%)

Due 9/30 @
11:55 PM

Program 3: Cookies (40 points)
Use skills from chapters 1 - 3.
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). Be sure to define "constants" for this and future programs.

Due 10/7 @
11:55 PM

Program 4: Gender Ratio (40 points)
Use skills from chapters 1 - 4.
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%.. Be sure to display the results as a percentage, not as a decimal.

Be sure to check the quality of your code with the Code Checker

Due 10/14 @
11:55 PM

Program 5: Hot Dog Cookout Calculator (60 points)
Use skills from chapters 1 - 5.
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)

Be sure to check the quality of your code with the Code Checker

Due 10/21 @
11:55 PM

Program 6: Change Maker Program (60 points)
Use skills from chapters 1 - 5.
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.

Be sure to check the quality of your code with the Code Checker

Due 10/28 @
11:55 PM

Program 7: Budget Analysis (100 points)
Use skills from chapters 1 - 6.
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")

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

Enter your budget amount (xxxx.xx): $1000
Enter an expense (xxx.xx): $500
Enter an expense (xxx.xx): $200
Enter an expense (xxx.xx): $0
You are $300.00 under budget.
Would you like to do another budget? (Y/N): N
Goodbye

Another example

Enter your budget amount (xxxx.xx): $500
Enter an expense (xxx.xx): $100
Enter an expense (xxx.xx): $100
Enter an expense (xxx.xx): $400
Enter an expense (xxx.xx): $300
Enter an expense (xxx.xx): $0
You are $400.00 over budget.
Would you like to do another budget? (Y/N): Y
Enter your budget amount (xxxx.xx): $1200
Enter an expense (xxx.xx): $200
Enter an expense (xxx.xx): $100
Enter an expense (xxx.xx): $300
Enter an expense (xxx.xx): $0
You are $600.00 under budget.
Would you like to do another budget? (Y/N): N
Goodbye

Notes:
  • If Y is entered to run again, the same input types are entered for each additional run.
  • Be careful, make sure that your program checks for captial Y.
  • You must validate inputs and reject negative monetary amounts. Make the user re-enter a valid amount.
  • You must define a "main" and at least two other functions for this program.

Be sure to check the quality of your code with the Code Checker

Due 11/4 @
11:55 PM

Program 8: Distance Traveled (100 points)
Use skills from chapters 1 - 6.
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.

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")

A sample run is listed below. 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

Another example:

Welcome to my Distance Calculator
Enter the vehicle speed: 20
Enter the hours traveled: 5

Hour Distance
----------------------
1 20
2 40
3 60
4 80
5 100
Do you want to run again? (Y/N): Y
Enter the vehicle speed: 80
Enter the hours traveled: 2

Hour Distance
----------------------
1 80
2 160
Do you want to run again? (Y/N): N

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.
  • You must define a "main" and at least two other functions for this program.

Be sure to check the quality of your code with the Code Checker

Due 11/16 @
11:55 PM

Program 9: Rock, Paper, Scissors (200 points)
Use skills from chapters 1 - 8.
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)

The program must give the following output:
  • If the human wins, loses, or draws, the program must say "You win", "You lose", or "draw" respectively.
  • The computer's move (rock, paper, or scissors) must be displayed i.e "Computer plays rock", "Computer plays scissors", or "Computer plays paper"

Notes:
  • 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.

Be sure to check the quality of your code with the Code Checker


This page was last modified on 2026-09-28 at 14:16:16.

Copyright © 2015–2026 George Fox University. All rights reserved.