Lab 14 PowerPoint

Download Report

Transcript Lab 14 PowerPoint

CS1112-202/206/207–Spring 2010
Lab 14 – Last Lab
Tuesday, May 4, 2010
Wednesday, May 5, 2010
1
How to Test Your Program
Without a Computer



For instance, during the exams
Ask yourself: What is the output of running the code?
Imagine yourself as a computer







Set aside blank piece of paper (e.g., back page of the exam)
Come up with an example
Start running your code and update your example as you go
along. Create a new variable on the paper if your program
does so.
If something’s wrong, then your code is wrong. Fix it!
Use pencil! Computer always erases its memory.
If you’re not sure, try a few (small) examples.
You can do this.
2
Takeaways from CS1112

There are many ways to solve a problem.

Some of them are more acceptable than others


Three steps in writing a program:

Designing
Implementing
Testing

How to drive a car

There is no free lunch




How to have bananas in your dorm room?
You should spend most of your time in the first
and last steps.
Functions as Black Boxes
Time-and-Space Tradeoff
3
Time’s Up.




Thanks for being here and participating.
Hope you enjoy the section. I always do.
See you at Mobile Office Hours and the final exam.
Reminder: Final Exam




Date:
Time:
Place:
Thursday, May 13, 2010
9-11:30AM
Barton Hall 100 West, Main Floor
Good luck!


See you around.
Feel free to say hi.
4