CS111A Project 02: Functions and Booleans -- Due Thu Sep 17 at 23:00
Deadline Note
The posted deadline for Project 02 is Thu Sep 17 at 23:00, and you should strive to complete all three tasks by this time. However, there is a policy that you should have at least 24 hours to review grading feedback from the previous project before submitting the next project. So the actual deadline is the later of (1) Thu Sep 17 at 23:00 and (2) 24 hours after Project 01 feedback has been published.
Reading
- Functions lecture slides and notebook (including the solutions notebook)
- Lab 2
- Booleans lecture slides and notebook (including the solutions notebook)
-
Optional reading from the Think Python book:
-
The following chapters cover material on functions:
- Think Python, Chapter 3: Functions
- Think Python, Chapter 6: Return Values covers fruitful functions, although you should only read sections 6.1, 6.2, and 6.4 for now. (We will cover other sections later in the course.)
- The following sections cover booleans:
-
Note that many of the same materials from last week are relevant this week again.
About this Project
This project will give you practice with defining custom functions. You will also have the opportunity to work with booleans in the context of defining a predicate.
As CS111A students, most of you are already familiar with more advanced
concepts like conditionals (i.e., if statements and expressions) and loops.
However, in this project, you must not use any conditionals or loops.
The tasks are designed to be solved with just functions and booleans,
without any conditionals or loops
Tasks
For this project you must do all three of the following tasks.
-
Task 1: Diamonds Use functions to avoid repeating code while printing out a repetitive pattern. This is an indvidual task that you must do on your own.
-
Task 2: Time Profiler Practice writing an entire interactive program from scratch that uses
inputandprint. You'll be able to calculate how much time you spend on different activities each week. For this task, having a partner is optional but recommended. - Task 3: Combining Booleans Practice using logical operations by definining a predicate that combines four boolean inputs. This is an indvidual task that you must do on your own.
How to Submit this Project
Note: Do not submit your task files until after you have reviewed the grading feedback from Project 01.
Drag and drop all of the following three files into the CS111A Gradescope Project02 assignment.
diamonds.py(from Task 1)timeProfiler.py(from Task 2)combineBooleans.py(from Task 3)
You may resubmit as many times as you like, but in each resubmission you must include all three files.