CMU 15-112 Fall 2016: Fundamentals of Programming and Computer Science
Lab 3 (Due Thursday 15-Sep, at 10pm, no extensions or grace days)



  1. leastFrequentLetters(s) [50pts]
    Write the function leastFrequentLetters(s), that takes a string s, and ignoring case (so "A" and "a" are treated the same), returns a lowercase string containing the least-frequent alphabetic letters that occur in s, each included only once in the result and then in alphabetic order. So:
       leastFrequentLetters("aDq efQ? FB'daf!!!") 
    
    returns "be". Note that digits, punctuation, and whitespace are not letters! Also note that seeing as we have not yet covered lists, sets, maps, or efficiency, you are not expected to write the most efficient solution. Finally, if s does not contain any alphabetic characters, the result should be the empty string ("").

  2. bestStudentAndAvg(gradebook) [50 pts]
    Background: for this problem, a "gradebook" is a multiline string where each row contains a student's name (one word, all lowercase) followed by one or more comma-separated integer grades. A gradebook always contains at least one student, and each row always contains at least one grade. Gradebooks can also contain blank lines and lines starting with the "#" character, which should be ignored.

    With this in mind, write the function bestStudentAndAvg(gradebook), that takes a gradebook and finds the student with the best average (ignoring the case where there is a tie) and returns a string of that student's name followed by a colon (":") followed by his/her average (rounded to the nearest integer). For example, here is a test case:
    gradebook = """
    # ignore  blank lines and lines starting  with  #'s
    wilma,91,93
    fred,80,85,90,95,100
    betty,88
    """
    assert(bestStudentAndAvg(gradebook) ==  "wilma:92"))
    
    Note: you most likely will want to use both s.split(",") and s.splitlines() in your solution.