CS8, Fall 2010
min, max, index vs. value
lab06 and lab07 have the same deadline, which
is one week from today.
Instead of assigning one 300 point lab this week, I've assigned two
smaller 150 point labs. They are both due at the same time, though.
Dividing them up has several benefits for you and the TAs:
- Each of the two labs focuses on a separate topic.
- You can complete lab06 and turn it in as soon as its done--that should take a bit of the pressure off so you can then just focus on lab07.
- Or if you get stuck on lab06, you can start on lab07, and then come back to lab07 after getting some help, or sleeping on it overnight
- Either way, the division allows you to pace yourself a bit over the next week.
- If you complete half of this weeks work on time, you don't get a late penalty on both parts.
- The TAs will be better able to divide up the grading and get your results back to you sooner.
Goals for this lab
By the time you have completed this lab, you should be able to understand the concept of min, max, index and value as they apply to lists.
In particular, you'll be able to:
- Find the largest or smallest number in a list (without using the min or max function) using a for loop
- Find the index of the largest or smallest number in a list
- This is needed when we have "parallel lists" that store, for example, names and score
- Understand the difference between finding the largest item, and the index of the largest item
- Apply this min/max idea to related concepts such as the length of a string.
Step by Step Instructions
The instructions for this lab are pretty much the same as for lab05.
You'll need to:
- Register your pair partner on the lab06/lab07 pair partner forum
- Note: this is required this week. You MUST do this in order to earn full credit for this lab.
- Start by reading over the entire lab—each of you should do this if you are working in a pair.
- Decide whose account you will be working in.
- Be sure to share the file with each other at the end of each work session, in case your pair partner disappears.
- Create a directory for lab06 in one of your accounts called ~/cs8/lab06
- Bring up IDLE and a window for function definitions, and start a file with the usual stuff at the top (see lab06 for details if necessary), and save the file with the (e.g. lab06.py).
- Copy the starting point file into your file and run it:
The starting point for this week's lab can be found at this link:
Then open the file, and follow the instructions in the usual way, until the file passes all the tests.
- Do your final inspection (see lab05 for the details), and then submit your lab06 directory on CSIL using this command:
turnin lab06@cs8 lab06
Evaluation and Grading Rubric (150 pts)
Making a post on the lab06/lab07 pair partner forum
- Follow the instructions on the forum
- The post needs to have both pair partner's names and the days/times you can get together between labs.
- It also needs to have answers to the questions about pair programming--i.e. what you'd like to see in an ideal partner, and what you'd like to avoid.
Professional software practices:
- Naming the file lab06.py
- Having a comment at the top of the file that complies with the instructions.
- All @@@ comments have been complied with and removed.
- Submission follows all instructions and is on time.
||smallestInt passes its tests and is written with good style
||indexOfSmallestInt passes its tests and is written with good style
||longestString passes its tests and is written with good style
||indexOfShortestString passes its tests and is written with good style
Due Date: Friday November 5, 5pm (same as lab07)
- You may turn it in late with a 30 point penalty through Wednesday November 10 at 11:59pm
- However, if you don't finish by Friday 11/05/2010 at 5pm, you are encouraged to at least finish before the next midterm exam, which is on Tuesday November 9 at 2pm.
- Completing this lab is one of the most important ways you can study for the next midterm exam.
Copyright 2010, Phillip T. Conrad, CS Dept, UC Santa Barbara. Permission to copy for non-commercial, non-profit, educational purposes granted, provided appropriate credit is given; all other rights reserved.