12.07.2015 Views

Exam #2 list of topics - TAMU Computer Science Faculty Pages

Exam #2 list of topics - TAMU Computer Science Faculty Pages

Exam #2 list of topics - TAMU Computer Science Faculty Pages

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CSCE 110: Programming I<strong>Exam</strong> <strong>#2</strong> — List <strong>of</strong> TopicsApril 5, 2011Below are a <strong>list</strong> <strong>of</strong> <strong>topics</strong> that <strong>Exam</strong> <strong>#2</strong> will cover. The exam material will include all materialfrom course lectures, course notes, labs, and quizzes that was discussed after <strong>Exam</strong> #1. Thepurpose <strong>of</strong> the exam is to test your ability to read and write Python programs.In terms <strong>of</strong> preparing for the exam, I have the following advice.1. Study weekly quizzes. Make sure you understand every question on the weekly quizzes.2. Reading practice. Gather all <strong>of</strong> the programs that we have discussed during class lecture. Foreach program that we discussed in lecture, trace through the code on paper. Next, comparethe output you got on paper with the output when the program is run on the computer. Ifthere is a match, then you understand the program. Otherwise, there is an issue with yourunderstanding <strong>of</strong> the program that must be resolved.3. Writing practice. Pick a few <strong>of</strong> the programs that we discussed during class lecture. Write adifferent solution for the problem. Remember, there is no one way to solve a problem.4. Study lab problems. Make sure you understand the lab problems. Many <strong>of</strong> the labs requiredyou to write several small functions in order to complete the assignment. These small functionsare perfect for test questions. For example, in lab #9, part <strong>of</strong> the solution to question #1required you to write a is_vowel(c) function to determine whether a character (i.e., a string<strong>of</strong> length 1) c is a vowel. Be able to read and write such a function for the exam.5. Study sample exam questions. There will a set <strong>of</strong> sample questions to also help you study forthe exam. The questions will be available on the course website by Wednesday, April 6th. Wewill go over a few <strong>of</strong> the questions in class on Thursday, April 7th.If you study in the above manner, you will be well-prepared for the exam.1. Modules2. Setsa) What is a module?b) A few modules we have used in our programs: random, matplotlib, and, numpya) Set operations such as union (|), intersection(&), difference (-), proper subset (), subset(=), membership (in), non-membership (not in)b) Methods such as add(), pop(), remove(), and discard()


c) How are sets, <strong>list</strong>s, tuples, and strings similar?d) How are sets, <strong>list</strong>s, tuples, and strings different?3. Simulation/Modelinga) A few problems we solved using simulation/modeling.i. On average, how <strong>of</strong>ten do heads and tails appear when flipping a fair coin?ii. On average, how many times do you need to roll a single dice before all six differentnumbers turn up?iii. The Monty Hall problemiv. On average, how many times do you need to flip a fair coin before you have seen anodd number <strong>of</strong> heads, followed by a tail?b) What were the main lessons we learned when it came to simulation/modeling and computerprogramming?4. Creating plots with Matplotliba) Be able to construct a simple plot using the module matplotlib.b) Plots we constructed include a line plot and a horizontal bar plot.c) How are plotting and simulation/modeling related?5. Python Docstrings6. Filesa) File types: .py, .txt, .csv, .docx, .xlsx, .pdf, etc.b) Comma Separated Values (CSV) formatc) Opening a filed) Closing a filee) Reading textf) Writing text7. Text file applicationsa) Analyzing numbers such as US ZipCodes and random numbers.b) Analyzing the content (number <strong>of</strong> lines, words, vowels, etc.) in a text file.c) Analyzing a CSV file and plotting the result.2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!