Fall 2013: 22c:005 Introduction to Computer Science (Lab)

Course Supervisor: Dr. Denise Szecsei

Lab Sections: Tue 4:30P - 5:20P (Section A02), Wed 9:30A - 10:20A (Section A03) at 301 MLH

Office Hours: Thu 2:30A - 3:20P, Fri 8:30A to 9:20A at 301 MLH and by appointment

Announcements

Change in Office Hours Schedule (posted on 9/25): Due to conflict with class schedule, my office hour on Wednesdays is shifted to Fridays. I am going have an extended office hour (from 8:30am to 10:20am) on Fridays, instead of (11:30am to 12:20pm) hour on Wednesdays.

Here is my new office hour schedule: Thu 2:30A - 3:20P, Fri 8:30A to 10:20A at 301 MLH and by appointment.

N.B. For this week, I will hold office hour on Wednesday (today), and as well as during the extended period on Friday.

HuqLab5.py file is updated (posted on 9/26): An alternative solution for the function replaceVowels() is added. You might find this solution more helpful to solve the HW problem 3.

About HW 4 problem 1 (posted on 9/26): Probably I stated in my discussion that my example findAStatetoVisit() is similar to HW problem 1. But later on I realized that this statement can be misguiding. I went though the homework statement again, and it clearly appears that you don't need any if-elif-else statement for HW problem 1. Please feel free to email me if you have any further confusions.

HuqLab13.py file is updated (posted on 12/5): There was a small bug in the previous file. The corrected file is posted.

HuqLab13.py file is updated again! (posted on 12/6): I didn't upload the right version yesterday! The right file is uploaded now, finally. Sorry about the mess.

Lab summary, examples and files (by week)

Week 1: We introduced python and wing IDE, and talked about print statement, variables, basic data-types and functions. We wrote and ran few simple functions by using Wing IDE.

Week 2: We revisited the concept of variables and data-types at the beginning. Then we wrote several programs to show how to build strings by concatenating different components. 

Example program: HuqLab2.py

Week 3: We talked about the basics of list and loop and python syntaxes associated with them. Topics covered include how to initialize, build and access lists in python, how to use basic list functions (e.g. len(), append(), max(), min(), sum() etc.), how does the append function differ from the concatenation operator (+) applied to join two lists, difference between equality operator (==) and assignment operator (=), how to write simple for and while loops, how to generate random numbers from a certain range of numbers etc. We also wrote some example functions to illustrate these concepts.

Example program: HuqLab3.py

Week 4: We talked about how to read inputs from keyboard, some differences between python version 2.7.x and 3.x.x, and basics of comparing two variables. Finally, we developed a guessing game program, targeting to impart necessary skills for HW3 to the students.

Example program: HuqLab4.py

Week 5: We talked about if-elif-else statements and the random.choice() function. Then we went through some examples to illustrate their use in programs.

Example program: HuqLab5.py

Week 6: We started the lab with a brief discussion on HW4 solutions. Then we talked about the break statement and use of different random functions. We wrote some example functions targeting to help students in doing their next HW.

Example program: HuqLab6.py

Week 7: We wrote and analyzed some programs that generate lists with random numbers and go through the list (by using a loop) to perform specific operations on the list (e.g. finding/counting a specific kind of elements). We also went though examples to show how to analyze a string by breaking it down to appropriate sub-strings.

Example program: HuqLab7.py

Week 8: We wrote a couple of programs in OAM assembly language, and explained them in detail by mimicking OAM operations in python function.

Example program: HuqLab8

Week 9: We continued our OAM Assembly Language programming, and covered examples that use loop.

Example program: HuqLab9

Week 10: We went through a quick overview of OAMPL, explaining the notion of major levels (machine, assembly and high-level) in programming languages. Then we solved (in Python) a sample problem as an exercise for the lab exam.

Example program: HuqLab10

 

Week 11: We demonstrated several example programs (in Python) to cover basic file operations. Our examples create, write, append and read files, as well as perform computations by using the data read from file. At the end, like the previous lab, we went through a sample problem for the lab exam, and wrote different solutions for that problem.

Example program: HuqLab11.py

Week 12: We wrote some programs related to lists, strings and file operations. Then we talked about HW problems and finally went through a sample problem for the lab exam.

Example program: HuqLab12.py

Week 13: Lab test (no discussion).

Week 14: Thanksgiving break (no discussion).

Week 15: We reviewed the lab exam. Then we developed a program that reads data from an input file (soccer.txt), generates XML tags for the data read, and writes in an output file.

Programs and the input file: HuqLab13.py     soccer.txt     SecA02-exam_review.py    SecA03-exam_review.py

Week 16: We reviewed the program we wrote in the last class and talked about some issues related to the project. Thanks everyone for attending and good luck for the final exams!