Difference between revisions of "IB Computer Science 1"

From WLCS
Line 1: Line 1:
 
== Wednesday (2/7/18) ==
 
== Wednesday (2/7/18) ==
 +
'''Warmup:'''
 +
# Read today's assignment
 +
# Working with a partner...
 +
# Outline specific programming tools or constructs (e.g. looping) that we will need to use and what we will use them
 +
 
'''Agenda:'''
 
'''Agenda:'''
 
* Letter Frequency Analysis
 
* Letter Frequency Analysis

Revision as of 07:42, 7 February 2018

Wednesday (2/7/18)

Warmup:

  1. Read today's assignment
  2. Working with a partner...
  3. Outline specific programming tools or constructs (e.g. looping) that we will need to use and what we will use them

Agenda:

  • Letter Frequency Analysis
    1. Check out Wikipedia: Letter Frequency for the table of percentages of how often specific letters of the alphabet appear
    2. Find a block of text of at least 500 words from any book, magazine, news article etc.
    3. Write a program that calculates the frequency of all the letters in the alphabet of your block of text (the values should be displayed as percentages)
      • Ignore spaces and punctuation (don't count them)
      • You must treat uppercase and lowercase letters the same (HINT: You can use functions/methods in String Methods)
      • You will need to keep track of all the counts of all the letters
      • Be sure to keep track of the total number of characters (use a variable) -- you need this so that you can calculate a percentage
    4. Execute your program and compare your percentages to the Wikipedia: Letter Frequency

Monday (2/5/18)

Agenda:

  • Turn in Feb 20th CTE Day permission slips ASAP!
  • Morse Code Sound Player
    1. Create a new file named morseCodePlayer.py
    2. Copy your plain->morse translation code
    3. Using the time and os modules, you will write a program that allows the user to input a string. The program will then translate to morse code, display the textual morse code, AND play the morse code sounds
    4. You may use the following sound files: Media:Dot.wav and Media:Dash.wav
    5. After your translate to morse code, you should iterate through your morse code string and check to see what each character is in order to play the appropriate sound (if the character is a dot, then play the dot sound).
    6. Whenever there is a space, you should sleep for about 50 milliseconds

Thursday (2/1/18)

Warmup:

  1. Complete the Internal Assessment Idea Survey Quiz on Canvas
  2. Time module
    • Skim through the module and find 3 useful functions

Agenda:

  • Reminder of current 3rd Quarter Assignments
    • Plain->Morse translator
    • Morse->Plain translator
    • Today: Morse Code Sound Player
  • Time module
    • Time module demo
  • How to play a sound file using os.system()
    1. Download Media:Dot.wav and Media:Dash.wav
    2. Create a python file to test out playing sound
    3. import os
    4. os.system("afplay FILENAME")
    5. make sure that the python file and the sound are in the same folder/director
  • Morse Code Sound Player
    1. Create a new file named morseCodePlayer.py
    2. Copy your plain->morse translation code
    3. Using the time and os modules, you will write a program that allows the user to input a string. The program will then translate to morse code, display the textual morse code, AND play the morse code sounds
    4. You may use the following sound files: Media:Dot.wav and Media:Dash.wav
    5. After your translate to morse code, you should iterate through your morse code string and check to see what each character is in order to play the appropriate sound (if the character is a dot, then play the dot sound).
    6. Whenever there is a space, you should sleep for about 50 milliseconds

Tuesday (1/30/18)

Warmup:

  1. Given the following string: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus velit sapien, porttitor id dui eget, elementum vehicula ligula. Maecenas dapibus sem ac turpis semper elementum. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam tellus nibh, suscipit semper risus sit amet, aliquet gravida quam. Vestibulum eget purus massa. Nullam a aliquam ex. Vestibulum luctus vulputate elit eu euismod. Aliquam ornare ipsum ac risus imperdiet laoreet. Donec facilisis porttitor nisi, ac efficitur felis vulputate quis."
  2. Write a program to count the total number of words (HINT: how are words separated?)

Agenda:

  • Thursday (2/1/18) -- be prepared to submit a 2-3 sentence description of your possible IA project
  • 2nd Quarter Exam Debrief
  • Introduction to Modules
    • A module is an external python file that gives you functions that you can use
    • A package is a collection of related modules
    • A library is a set of core, built-in modules (sometimes used synonymously as package)
  • Time module
    • Skim through the module and find 3 useful functions
    • Time module demo
  • How to play a sound file using os.system()
    1. Download Media:Dot.wav and Media:Dash.wav
    2. Create a python file to test out playing sound
    3. import os
    4. os.system("afplay FILENAME")
    5. make sure that the python file and the sound are in the same folder/director
  • Morse Code Sound Player
    1. Create a new file named morseCodePlayer.py
    2. Copy your plain->morse translation code
    3. Using the time and os modules, you will write a program that allows the user to input a string. The program will then translate to morse code, display the textual morse code, AND play the morse code sounds
    4. You may use the following sound files: Media:Dot.wav and Media:Dash.wav
    5. After your translate to morse code, you should iterate through your morse code string and check to see what each character is in order to play the appropriate sound (if the character is a dot, then play the dot sound).
    6. Whenever there is a space, you should sleep for about 50 milliseconds

Thursday (1/25/18)

Warmup:

  • Complete the Extra Credit Mid-Year Feedback quiz on Canvas

Agenda:

  • Complete Morse Code Translator
    • You do not have to use a dictionary for morse->plain
    • Challenge: Within your morse->plain code, implement a feature that detects when spaces should be entered in the plain string to separate words
  • Coming soon: Playing sound
  • Upcoming warmup/homework: 2-3 sentence description of your possible IA project

Tuesday (1/23/18)

Agenda:

Friday (1/19/18)

Agenda:

Wednesday (1/17/18)

Agenda:

  • Internal Assessment introduction
  • Complete and demo Pig Latin Translator
  • Work on Morse Code Translator
  • Quarter Assessment on Tuesday (1/23/18)
    • Basically everything we've done in Python up to this point
    • Focus on if-statements, functions, while loops, and strings

Wednesday (1/10/18)

Agenda:

Monday (1/8/18)

Agenda:

Tuesday - Thursday (1/2/18 - 1/4/18)

Agenda:

Archives