Difference between revisions of "IB Computer Science 1"

From WLCS
(Monday (3/4/19))
(Monday (3/4/19))
Line 14: Line 14:
 
*# You will define a function named harvestEmail(s) that takes a string as a parameter. Your function will return the e-mail address within the string s
 
*# You will define a function named harvestEmail(s) that takes a string as a parameter. Your function will return the e-mail address within the string s
 
*# Assume that the s parameter will have an e-mail address and all e-mail addresses have an @ symbol
 
*# Assume that the s parameter will have an e-mail address and all e-mail addresses have an @ symbol
*# Use a loop to find the index of the @ symbol.  Basically, check if each character is the @ symbol, and if it is, then remember the current index
+
*# Use a loop to find the index of the @ symbol.  Basically, check if each character is the @ symbol, and if it is, then remember the current index.  Be sure to break out of the loop when you find the @ symbol
*# Use a loop to find the index of the space " " character before the @ symbol (this is the beginning of the e-mail address).  Hint: Start your loop counter at the index of the @ symbol, and count backwards/downwards
+
*# Use a loop to find the index of the space " " character before the @ symbol (this is the beginning of the e-mail address).  Hint: Start your loop counter at the index of the @ symbol, and count backwards/downwards. Be sure to break out of the loop when you find the space
*# Use a loop to find the index of the space " " character after the @ symbol (this is the end of the e-mail address). Hint: Start your loop counter at the index of the @ symbol
+
*# Use a loop to find the index of the space " " character after the @ symbol (this is the end of the e-mail address). Hint: Start your loop counter at the index of the @ symbol. Be sure to break out of the loop when you find the space
 
*# Return the e-mail address by string slicing the indices of the beginning and end of the e-mail address
 
*# Return the e-mail address by string slicing the indices of the beginning and end of the e-mail address
 
*# Submit to repl.it
 
*# Submit to repl.it

Revision as of 23:10, 3 March 2019

Monday (3/4/19)

Agenda:

  • Confirm that you have completed and submitted the Count Vowels and Count Words repl.its
  • Date Format Validation repl.it (no loops)
    1. You will define a function named checkDateFormat(dateStr) that takes a string as a parameter. Your function will return True if the date string is valid, and False otherwise
    2. A date string is valid if it adheres to the following rules:
      1. Must be in the format: MM/DD/YYYY
      2. MM must be a valid 2-digit month (01 -> 12)
      3. DD must be a valid 2-digit day (01 -> 31)
      4. YYYY must be a 4-digit number
    3. Guidance: You should use any and/or all programming strategies to help you define the function: checking the string length, string slicing, checking if specific characters are valid, etc.
    4. Submit to repl.it
  • E-mail Harvester repl.it
    1. You will define a function named harvestEmail(s) that takes a string as a parameter. Your function will return the e-mail address within the string s
    2. Assume that the s parameter will have an e-mail address and all e-mail addresses have an @ symbol
    3. Use a loop to find the index of the @ symbol. Basically, check if each character is the @ symbol, and if it is, then remember the current index. Be sure to break out of the loop when you find the @ symbol
    4. Use a loop to find the index of the space " " character before the @ symbol (this is the beginning of the e-mail address). Hint: Start your loop counter at the index of the @ symbol, and count backwards/downwards. Be sure to break out of the loop when you find the space
    5. Use a loop to find the index of the space " " character after the @ symbol (this is the end of the e-mail address). Hint: Start your loop counter at the index of the @ symbol. Be sure to break out of the loop when you find the space
    6. Return the e-mail address by string slicing the indices of the beginning and end of the e-mail address
    7. Submit to repl.it

Thursday (2/28/19)

Agenda:

  • Demonstrate Morse->Plain translator
    1. Run your Plain->Morse
    2. Copy the morse code and paste it back into Morse->Plain
  • Complete the Count Vowels repl.it
  • Complete the Count Words repl.it

Homework:

  • Complete Count Vowels and Count Words if you did not finish in class

Tuesday (2/26/19)

Agenda:

  • Morse Code updates
    • Make sure both Part 1 and Part 2 of Morse Code Translator are complete
    • Part 1 you can submit to repl.it
    • Part 2 will have a repl.it submission soon...
  • File Reading
    • open()
    • read()
  • Integrate file reading into your morse code

Friday (2/22/19)

Agenda:

  • Take the Strings Quiz in Canvas
    • Closed-book, closed-note, closed-person
  • Work on Morse Code Translator
    • Complete Part 1: Plain -> Morse
    • Repl.it auto-testing will be used to collect assignment
    • Complete Part 2: Morse -> Plain (with a function)
  • Challenge:
    1. Research Python dictionaries
    2. Re-implement both plain2morse.py and morse2plain.py so that they use dictionaries instead of functions

Wednesday (2/20/19)

  • Snow Day

Friday (2/15/19)

Agenda:

  • While loops quiz (5 mins)
  • Introduction to Strings
  • Strings (Python) slides
    • Complete the Basic Strings Exercises in Canvas
  • Review Basic Strings Exercises
  • Strings quiz next week
  • Work on Morse Code Translator
    • Complete Part 1: Plain -> Morse
    • Repl.it auto-testing will be used to collect assignment

Wednesday (2/13/19)

Warmup:

  1. You are creating a program that asks the user to enter an angle within the 2nd quadrant of the coordinate plane (90-180 degrees)
  2. Write a while loop that will continually ask the user to enter an angle while the number is not within the range

Agenda:

  • Looping examples
    • Acceptable ranges
    • Generating non-overlapping coordinates
  • While loops quiz on Friday (2/15/19)

Monday (2/11/19)

Warmup:

  • Complete the 2 minute While Loops Practice Quiz in Canvas

Agenda:

  • While Loops Practice Quiz debrief
    • You will have a real time quiz in the future (Wednesday or Friday)!
  • Demo Taylor Series Pi and e if you have not already done so
  • WPM Survey
  • Looping examples
    • Authentication (login screens)
    • Acceptable ranges

Thursday (2/7/19)

Agenda:

Tuesday (2/5/19)

Warmup:

  • Complete the printStr function & loop warmup in repl.it

Agenda:

  • Workplace Readiness Skills Assessment - Thursday (2/7/19)
    • Go to the Cafeteria @ 8:19am if you have not already taken the assessment
    • 1st period students who have already taken the assessment will sit quietly off to the side of the cafeteria
  • Complete and demo the Monte Carlo Calculation of Pi (Wing IDE)
    • Additional challenge: Animate your Monte Carlo Pi calculation using Processing
  • Slightly more advanced looping practice:
    • Add up all the numbers from 539 through 9394
    • Calculate 41! (<-factorial)
  • Euler's identity
  • Complete Taylor Series Pi and e

Friday (2/1/19)

Agenda:

  • Verify that you have completed the isPrime function and loop assignment in repl.it
  • Complete and demo the Monte Carlo Calculation of Pi (Wing IDE)
    • Additional challenge: Animate your Monte Carlo Pi calculation using Processing

Archives