# Template file for Homework 12, CS 151, Fall 2010, ISU
#
# Name: (put your name here)
#


# This first line has JES load all the functions from the
# cs151functions.py file so we can use them in this file too.
# So we will have this as the first line in our Python files from
# now on.
#
# Make sure to download the latest version of cs151functions.py from the 
# course webpage (make sure to right-click and "Save target as" or 
#  "Save link as" or whatever your browser calls it.)
#
# And then do the following in the command area, and select
# the folder that has cs151functions.py in it:
#
# >>> setLibPath(pickAFolder())
from cs151functions import *

#
# Problem 1 (-3 points if you do not fill this in.)
#
def collaborators():
  # put into s who you worked with on this homework, "none" if none.
  s = ""
  print "I collaborated with:", s
# ** Note on collaboration: You should not turn in work that is not your own.
#    To make sure you are not violating this, if you work with someone, 
#    you should destroy the file once you are done working together, go 
#    your separate ways, and then you should be able to recreate the file
#    on your own, then turn that in.  If you cannot recreate the file on your
#    own, then it is not your work, and you should not turn it in.
# ** Note on sources: if you use some other source, the web or whatever, you
#    better cite it!  Not doing so is plagiarism.



# Problem 2 (10 Points)
# 
# Fill in the missing code to complete this function.  The
# function is supposed to ask the user what information they 
# want to know about "CS Hero", and then should get that information
# out of the string variable aboutCSHero and print it.
def getCSHeroInfo():
  aboutCSHero = """Name: CS Hero
Achievments: land a person on the moon
Likes: electrons, cool and not too humid, logic
Nemesis: the halting problem
Pets: mouse"""
  msg = "What do you want? (0 for name, 1 for achievements, 2 for likes, 3 for nemesis, 4 for pet)"
  choice = requestInteger(msg)
  #if (choice < ___ or choice > ___):
  #  print "Bad input.  Should have been 0, 1, 2, 3, or 4."
  #  return
   
  # create a list of the information about CS hero, it should have 5 things in it. 
  #infoList = aboutCSHero.split(___)

  # get the particular item they asked for out of the list.  If they entered 0, 
  # you should get the name, etc.
  #info = infoLost[___]

  #print info
  #return info
  
  

# Problem 3 (10 Points)
# 
# This function should open up the file called filename, read in all of 
# the numbers in the file and compute the average number.  You can assume
# the text in the file is a bunch of numbers that are separated by spaces, 
# all on one line.
#
# Functions you will probably need to do this problem:
# file functions (open, read, close)
# split that works with strings
# float that converts a string to a number.
#
# If you do not remember how to use these functions, look them up 
# in the book or in the sample files from class!  Do this
# before trying to solve the problem!
def avgFromFile(filename):
  total = 0
  avg = 0
  
  print "The average is", avg
  return avg
  
  
# Problem 4 (10 Points extra credit)
#
# Create a function that uses the random library and 
# creats a picture showing the bell curve of the gaussian
# distribution that has a given mean and variance.  You 
# should take numSamples number of samples from the 
# gaussian distribution and for each one plot it in a 
# picture.  At the end, you should display the picture.
def bellCurve(mean, variance, numSamples):
  print "Delete this line."
