Final Assessment
You will spend this class period completing the flickr exercise and demonstrating what you have learned over the course of the semester. This is worth 25 project points. You will do as many of these short programs as you can and will be graded based on completeness, how on-task you are and the appropriateness of the problems you choose to solve. Aim to demonstrate as much knowledge as you can.
Please make sure there is a comment at the top of your program indicating your name. Please separate each question with a comment indicating which question you are answering (Novice 1, for example).
For all sample runs below, input is underlined. You don’t need to underline anything.
Novice
- Write turtle graphics code that draws an equilateral triangle.
- Write code that prompts the user for their name then greets them. Here is an example run of this program:
What is your name? Bob
Hello, Bob. - Write code that generates three random numbers between 1 and 5, adds them up and prints ‘you win’ if their sum is above 10.
- Write code that prompts the user for a number and then prints whether that number is within 10 of 100. Here is an example run of this program:
Enter a number: 6
No, 6 is not within 10 of 100.
Proficient
- Write a program which prompts a user for a line of text. Your program should split that text into a list and then tell the user whether the first and last items were the same. Here is an example run of this program:
Please enter a list of items: bananas planes violins bananas
Yes, the first and last are the same. - Write code which prompts a user to enter a temperature as an integer. Your program will print “it is hot” is the temperature is over 100, “it is cold” if the temperature is under 60, and “it is just right” if the temperature is between 61 and 99 inclusive. The program continues to ask for termperatures, and evaluates them as above, until the user enters a temperature of 0. Here is an example run of this program:
Please enter a temperature: 95 It is just right. Please enter a temperature: 110 It is hot. Please enter a temperature: 32 It is cold. Please enter a temperature: 0 Good bye!
- Translate the following for loop into a while loop that does the same thing
for i in range(10): print "i = " + str(i) - Write code that prompts the user for a total bill amount at a restaurant then displays the total with a 15% tip and a 20% tip. Here is an example run of this program:
How much was your meal? 10
Total with 15% tip: $11.5
Total with 20% tip: $12
Ninja
- Write code that plays a guessing game with the user. This time, your program should try to guess what the user is thinking. A sample run of the program:
Please think of a number between 1-100 and I will try to guess it.
Are you thinking of a number between 1-100? yes
Is it 50? no
Is it higher than 50? yes
Is it 75? no
Is it higher than 75? no
Is it 62? yes
I got it in 3 tries!
Are you thinking of a number between 1-100? no - Write code that checks whether the content of a list is a palindrome. For example ['p', 'e', 'e', 'p'] is a palindrome because it is the same forwards and backwards. (Hint: you may want to first write a function that reverses a list so that you can then use that to check whether the list is the same forwards and backwards)
- Continue working on the star chart program
- Look at the zip codes data file and implement some of the features described in this assignment, or come up with your own.
- If you have a good idea you want to pursue, you may… but make sure you’re demonstrating proficiency and not just getting bogged down in design!





