CS111A Project 03 Conditionals and While Loops - Due Mon Sep 28 at 23:00
Deadline Note
The posted deadline for Project 02 is Mon Sep 28 at 23:00. This is later than the Fri Sep 25 18:00 "dueish" deadline originally announced because the Project 03 description was posted so late. Nevertheless, you should strive to complete as many of the Project 03 tasks as soon as you can so that you get more practice with the material and are better prepared for the new topics in class that depend on this material.
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) Mon Sep 28 23:00 and (2) 24 hours after Project 02 feedback has been published.
Reading
- Slides and notebooks from the Booleans lecture, the Conditionals lecture, and the While Loops lecture.
- New material on combining booleans and conditional expressionscovered in Lab 3.
-
Optional reading from the Think Python book:
-
The following sections cover booleans and conditionals:
-
Think Python, Ch. 7: Iteration (while Loop material covered only in 2nd edition, not in 3rd edition).
- Think Python, Ch. 8: Strings (only Secs. 8.1-8.5)
-
About this Project
This project will give you practice with defining predicates (functions that return booleans),
using conditional statements and conditional expressions, and writing while loops.
Some CS111A students might have previous experience with Python's for loops, which we have already
started to learn in class. However, on this particular assignment, all loops
you write must be while loops; you must not use any for loops.
Also, you might be tempted to use sequences other than strings
(such as lists and ranges), but those are prohibited in this assignment as well.
Tasks
For this project you must do all three of the following tasks.
-
Task 1: Animal Quiz Ask the user some questions to decide (using booleans and conditionals) what kind of animal they might be. This is an indvidual task that you must do on your own.
-
Task 2: Decimal to Binary (still under construction)
Use a
whileloop to convert a decimal integer to a string of binary digits. For this task, having a partner is optional but recommended. -
Task 3: Decimal to Binary (still under construction)
Use
whileloops to find multiples of numbers that have a remarkable property. For this task, having a partner is optional but recommended.
How to Submit this Project
Note: Do not submit your task files until after you have reviewed the grading feedback from Project 02.
Drag and drop all of the following three files into the CS111A Gradescope Project03 assignment.
animalQuiz.py(from Task 1)decimalToBinary.py(from Task 2)remarkableMultiples.py(from Task 3)
You may resubmit as many times as you like, but in each resubmission you must include all three files.