Presentation is loading. Please wait.

Presentation is loading. Please wait.

BIOL 548C,D Wednesday 9-12 Biodiv 224 Wayne Maddison All those registered: Please send Wayne your address.

Similar presentations


Presentation on theme: "BIOL 548C,D Wednesday 9-12 Biodiv 224 Wayne Maddison All those registered: Please send Wayne your address."— Presentation transcript:

1 BIOL 548C,D http://salticus.zoology.ubc.ca/2016BIOL548CD/ Wednesday 9-12 Biodiv 224 Wayne Maddison All those registered: Please send Wayne your email address Those not registered: Send Wayne your email address if you want to get emails about the course. NOTE: for code submitted, include your name in a comment at the top of the file!!!!!!

2 In high school: FORTRAN: ~1974 Small projects: BASIC: 1980s MacClade: Pascal: 1980s – 90s Assembly: 1990s C: 1990s Mesquite: Java: 1990s-now Small projects: R: 2010s Python: 2010s-now My programming background

3 Motorola 68000 assembly language same function in C

4 In high school: FORTRAN: 1970s Small projects: BASIC: 1980s MacClade: Pascal: 1980s – 90s Assembly: 1990s C: 1990s Mesquite: Java: 1990s-now Small projects: R: 2010s Python: 2010s-now

5 Please instruct me to make a peanut butter sandwich.

6 Making a peanut butter sandwich. What exactly is the target? What raw materials do you have? What are the available actions? Programming requires a particular way of thinking. It may come easily for you; it may not.

7 Designing a program Fred: For my project I want to write a program that finds the sum of a set of numbers. [My thought: I wonder if Fred has thought about how the set of numbers will be input into the program. Read from a file? Typed by hand at the terminal?] Me: How will the program find the sum? Fred: It will just add them up. Me: All at once? Programs don’t work all at once. How will it do this step by step?

8 Fred: It will take the first number, then add the second number then add the third number, and so on, until it’s done. Me: You’re implying a running total, correct? The running total is a place where it’s remembering the total as it goes. You need to think about this explicitly as a variable that contains the running total. OK, tell me again, how will the program work? Fred: It will put the first number into the running total. Then it will add the second number to the running total. And keep going until it’s done. Me: If there are 1000 numbers in the list, will the program need to have 1000 lines of code, each adding the next number?

9 Fred: Um, maybe there’s some way it can just say repeat until done? Me: OK, write me some pseudo-code. Fred: Put first number into total. Repeat the following until you’re at the last number: Add current number into total. Set the next number as the current number. Me: OK, that’s generally the right idea, but whether it will work or not depends on exactly how you write this in Python. This is a typical sequence of progress: gradual clarification of a program from general goals to specific details.

10 PROJECTS 1 for 548D 3 for 548C (could be stages of a single big project) Do you have a project or projects you want to accomplish? Maximum half page tentative proposal for each project due next Wednesday (this counts with the weekly exercises) For each, indicate: what information do you think will be input into the program? what is the result you hope the program gives? (e.g. what output result or calculation or visualization) what difficult/complex calculations (if any) are involved? Feel free to give alternatives if you can’t decided among several.


Download ppt "BIOL 548C,D Wednesday 9-12 Biodiv 224 Wayne Maddison All those registered: Please send Wayne your address."

Similar presentations


Ads by Google