Name(s)_______________________________________________ Period ______ Date ___________________
Project - Make a Library
Project Description
Libraries let you build functions that you and others can use to help build more powerful apps in lots of situations. As
the designer of a library you not only need to know how to program, you also need to think about the many different
kinds of programs other people might build.
For this project you will design and build a library of functions around any topic you want. You will have an opportunity
to exchange feedback with another group about how you might use their library to design an app. Finally you will
answer a few questions about the library you designed.
You will submit
● A link to your library of functions
● This completed project guide
Library Requirements
● Your library must contain two or more functions
● At least one function must include
○ A loop
○ An if-statement
○ One or more parameters
○ Return
Step 1 - Brainstorm
Your library can be about any topic. If you need some ideas try the list below
● Strings
○ Capitalize: Capitalize first letter of each word in a sentence (long string)
○ Trim: Remove spaces from beginning and end of a string
○ Remove Letter: removes a given letter from a string
○ Anything else you'd want to do with a string
● Lists
○ Maximum: Find the maximum value in a list
○ Minimum: Find the minimum value in a list
○ Average: Find the average value in a list
○ Count: Count how many times a given value appears in a list
○ Combine: Join two lists together in one longer, larger list
○ Filter Numbers: Keep numbers in a list greater than or less than a provided value
○ Filter Letters: Keep strings in a list that begin with a given letter
○ Numbered List: Turn a list into a string with each item numbered and appearing on a different line
○ Top 3: Return the three biggest numbers in a list, in sorted order (This can be a little tricky)
○ Unique: Return a list of each unique item that appears in (This can be a little tricky)
○ Sort: Return the list in sorted order (This can be a little tricky)
○ Anything else you'd want to do with a list
● Dataset
○ Choose a dataset and build a function that will help a user access or summarize specific information
within that dataset
● Something else
○ As long as your library does something interesting and valuable
Step 2 - Design
After you've brainstormed the focus of your library, fill in the table below with the list of functions you intend to build.
Computer Science Principles 1
Function Name Description, Parameters, Return Loop, If-statement, Param, Return?
Write the name of Write the comments for this function At least one function must include all 4
each function features listed above
maximum(list) // Takes a list and returns the largest value Yes this function should include all of
that appears in the list these features.
// list {list} - the list of items
// return {number} - the largest number in
the list
Step 3 - Build
Program your library. Make sure you do the following.
● Start by building the function that will include all four required features (param, return, if-statement, loop)
● Debug your code as you write it
● Start testing your code early with sample inputs
Step 4 - Test
Write test cases for each of the functions in your library to make sure they return the expected values. Remember that
you should include.
● Inputs (arguments) that will result in your functions behaving differently or returning different values
● Inputs (arguments) just before, at, and after cut offs if your conditionals. For example if your code includes the
statement (value < 2) then try inputs where value is 1, 2, and 3 to see if the algorithm always behaves as you
expect.
Note: Once you are done testing your functions, make sure to comment out any tests you have written into your code
to test your library functions before sending your library to a classmate in Step 5.
Computer Science Principles 2
Step 5 - Share and Feedback
Send your library to a classmate and have them send it to you. You shouldn't need to explain anything about how your
library works or what it is for. The documentation should be good enough.
Your reviewer should fill in the information below.
Reviewer Name: _________________________________________________
Yes Kind Of No
Clear: I can easily understand the overall purpose of
the library and each function within it.
Error-Free: Each function in the library works as
expected.
Useful: I can think of situations where I would want
to use this library
I like: Give feedback on at least one thing you like in the library
I wish: Give one problem or limitation of the library
What if: Give one idea for how to improve the library
Step 6 - Improve
Based on the feedback above make final improvements to your library.
Step 7 - Acknowledge Collaborators / Sources
It is important to acknowledge any code you write that was developed collaboratively or that you received from another
source. In the table below list work you completed with a collaborative partner or got from another source
Name / Source Lines of Code / Portions of Program Contributed
Computer Science Principles 3
Step 8 - Free Response - Practice Personalized Project Reference Sheet
Procedure: Capture and paste two program code segments you developed during this project that contain a student-
developed function that implements an algorithm used in your program and a call to that function.
I. Copy and paste a function definition from your library that:
a. Defines the procedure’s name and return type (if necessary)
b. Contains and uses one or more parameters that have an effect on the functionality of the procedure
c. Implements an algorithm that includes sequencing, selection, and iteration
Paste the code of your procedure here
II. Copy and paste an example call to the function definition above.
Paste the call to your procedure here
Computer Science Principles 4
Step 9 - Free Response - Create Performance Task Writing Practice
1. Refer to a code segment from your project that performs a specific task.
(a) Write documentation that describes the purpose of this code segment. Your documentation should explain
what the code does, its inputs, and its expected outputs.
(b) Explain how this code segment would contribute to the overall functionality of a program.
Write your response here
2a. Consider an algorithm in your program that performs a specific task.
(i) Describe this algorithm and its intended result.
(ii) Write a new algorithm that could perform the same task. Compare how the two algorithms function and
explain whether or not they yield the same result or side effect. If it is not possible to write a new algorithm that
produces the same result, explain why.
Write your response here
2b. Refer to a function or algorithm in your program that processes input data.
(a) Identify at least two different sets of inputs that you would use to test this algorithm.
(b) Describe the expected output or behavior for each input, and explain how this helps verify that the algorithm
works correctly.
Write your response here
2c. Refer to a procedure in your program that performs a specific task.
(a) Explain how this procedure manages complexity in your program by breaking down a larger problem into
smaller tasks.
(b) Describe how using this procedure improves the organization of your program and makes it easier to
maintain or modify.
Write your response here
Computer Science Principles 5
Scoring Guidelines
Written Responses (individual) - In the Written Response the student...
Responses Point
(Question 1) Explains the purpose of the code segment, including what it does and its inputs and outputs. /1
(Question 1) Explains how the code segment contributes to the overall functionality of the program. /1
(Question 2a) Describes the algorithm and its intended result. /1
(Question 2a) Writes a new algorithm to perform the same task, or explains why writing a new algorithm is /1
not possible.
(Question 2a) Compares whether or not the two algorithms produce the same result. /1
(Question 2b) Describes two sets of inputs that can be used to test the algorithm /1
(Question 2b) Describes the output of each input and explains how this helps verify the algorithm works /1
correctly.
(Question 2c) Explains how the function manages complexity in the program /1
(Question 2c) Explains how the function improves organization and makes the program easier to maintain or /1
modify
Program Code
Library includes two or more functions that accomplish related tasks /2
All functions include comments that explain the purpose of the function and the parameters /2
All functions include tests that demonstrate the code working as expected /2
Library code runs without errors /1
Project Guide
Project guide is complete /1
Student provided clear and actionable feedback to a classmate on their project guide /1
Total /18
Computer Science Principles 6