Skip to content

Instantly share code, notes, and snippets.

@bmontana
bmontana / U05_Ex14_WordCount.py
Last active October 12, 2017 11:44
Displays counts of lines, words, and characters in a file
# U05_Ex14_WordCount.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 11 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 14
@bmontana
bmontana / U05_Ex15_ExamScoresGraph.py
Created October 12, 2017 12:56
Plots a horizontal bar graph of student exam scores from an input file. Graph size is determined by number of students.
# U05_Ex15_ExamScoresGraph.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 12 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 15
@bmontana
bmontana / U05_Ex16_HistogramData.py
Created October 12, 2017 23:10
Populates a data file for use with U05_Ex16_Histogram.py Each of 100 lines contains an integer from zero to ten.
# U05_Ex16_HistogramData.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 12 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 16
@bmontana
bmontana / U05_Ex16_Histogram.py
Last active October 17, 2017 15:36
Reads numerical data from a file and displays a histogram Data file is created by U05_Ex16_HistogramData.py
# U05_Ex16_Histogram.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 12 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 16
@bmontana
bmontana / U06_Ex01_OldMacDonald.py
Created October 21, 2017 18:27
Prints the lyrics of the song "Old MacDonald" for five different animals.
# 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_Ex03_SphereAreaVol.py
Created October 21, 2017 18:47
Solve PE 3.1 using functions sphereArea() and sphereVolume(). Calculates the volume and surface area of a sphere from its radius, given as input.
# U06_Ex03_SphereAreaVol.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 3
@bmontana
bmontana / U06_Ex04_Sums.py
Created October 21, 2017 19:08
Prints the sums of the first n natural numbers (1, 2, 3, ...) and of their cubes.
# U06_Ex04_Sums.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 4
@bmontana
bmontana / U06_Ex07_Fibonacci.py
Created October 21, 2017 20:41
Solve PE 3.16 using function nthFibonacci(). Computes the nth Fibonacci number in the classic sequence
# U06_Ex07_Fibonacci.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 7
@bmontana
bmontana / U06_Ex09_LetterGrades.py
Created October 21, 2017 20:56
Solve PE 5.3 using function letterGrade(). Accepts an exam score as input and prints the corresponding letter grade
# U06_Ex09_LetterGrades.py
#
# Author: Bill Montana
# Course: Coding for OOP
# Section: A3
# Date: 21 Oct 2017
# IDE: PyCharm Community Edition
#
# Assignment Info
# Exercise: 9
@bmontana
bmontana / U06_Ex11_SquareEachInList.py
Created October 21, 2017 21:20
Modifies a list of numbers by squaring each item in list
# 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