Skip to content

Instantly share code, notes, and snippets.

@bmontana
bmontana / U08_Ex05_isPrime.py
Created December 1, 2017 18:56
Determines if a given number is prime using a function called is_prime()
# U08_Ex05_isPrime.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 22 Nov 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 5
@bmontana
bmontana / U08_Ex04_SyracuseSequence.py
Created December 1, 2017 18:56
Prints the Syracuse sequence for a given starting natural number syr(x) = x / 2, x is even syr(x) = 3x + 1, x is odd
# U08_Ex04_SyracuseSequence.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Nov 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 4
@bmontana
bmontana / U08_Ex03_DoubleInv.py
Created December 1, 2017 18:55
Determines how many years are required to double an investment at a given APR
# U08_Ex03_DoubleInv.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Nov 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 3
@bmontana
bmontana / U08_Ex02_Windchill.py
Created December 1, 2017 18:54
Finds every prime number less than or equal to a given number. Uses is_prime() from U08_Ex05_isPrime.py
# U08_Ex02_Windchill.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Nov 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 2
@bmontana
bmontana / testCode.py
Last active November 29, 2017 22:22
This tests functions written in other programs. The function must not print. It must return a single value.The value can be of any type, including lists containing multiple values of differing types. So, if your function needs to return multiple values, put them in a list or tuple.
# testCode.py
#
# Author: Bill Montana
# Date: 29 Nov 2017
# IDE: PyCharm Community Edition
#
# Program Description
# This tests functions written in other programs. The function must not print. It must return a single value.
# The value can be of any type, including lists containing multiple values of differing types. So, if your
# function needs to return multiple values, put them in a list or tuple.
@bmontana
bmontana / U07_Ex11_LeapYear.py
Created October 30, 2017 21:12
Unit 7 Problem Set 7.2
# U07_Ex11_LeapYear.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 24 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 11
@bmontana
bmontana / U07_Ex01_Overtime.py
Created October 28, 2017 18:54
Unit 7 Problem Set 7.1
# U07_Ex01_Overtime.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 22 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 1
@bmontana
bmontana / U06_Ex11_SquareEachInList.py
Last active October 22, 2017 17:17
COOP2017 Unit 6 PS 2
# U06_Ex11_SquareEachInList.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 11
@bmontana
bmontana / U06_Ex01_OldMacDonald.py
Last active October 22, 2017 17:19
COOP2017 Unit 6 PS 1
# U06_Ex01_OldMacDonald.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 1
@bmontana
bmontana / U06_Ex14_SumNumbersInFile.py
Last active October 21, 2017 22:15
Computes the sum of the squares of numbers read from a file specified by user. Assumption: data file contains one number per line
# U06_Ex14_SumNumbersInFile.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 14