Programming Assignment 6

Due Date: Tuesday, February 21, 10:00PM Pacific Time

Learning Goals


Different assignments in this course have different collaboration policies. On this assignment, you cannnot collaborate with anyone. Your submission must be your own work and you cannot share or post code from your submission anywhere other than to hand in the assignment.

The starter code is available at:

Submission checklist


Make a copy of this Doc. You will fill it in as you work.

Your task is to complete two of the following programs of your choice, and also complete a reflection while you are working.

When you’re ready to start programming, set a timer for 30 minutes – work on these tasks for that much time. Then, take a screenshot or copy/paste (a) your code and (b) the output of the most recent time you ran the program. It’s totally fine if running your code is producing errors at this point, the idea is just to take notes on progress.

Put that output into the Google Doc at the 30 minute mark, and write down a few sentences about your thought process at this point. Also note if you got distracted by another browser tab, your phone, etc during that 30 minutes. You don’t have to tell us how, just say yes/no and how many minutes you think you were distracted for.

When you work again, set another 30 minute timer and work for that time, then repeat taking notes. Then do this one more time, for a total of three 30 minute sessions each followed by note-taking.

If you don’t finish the task, still stop after the three sessions and put the notes for the reflection in place (it’s not expected that you must finish in 90 minutes, though you do have to finish, see below). If you finish early, note the time you finished.

The tasks, which you should complete two of, are here:


After you’re done with all three sessions (not necessarily the whole assignment), reflect on the following:

Some comments on this process: this may not be the ideal way for you to work. Sometimes I get a lot of “programming” done while walking my dog, and sometimes setting a problem down for a while and coming back to it is the best thing. You might be working on a day where other urgent obligations interrupt you every 5 minutes. Sometimes you may need to focus really hard for several hours to make any progress. So I don’t expect that you can or should always follow this process. However, doing it once might give you a useful scaffolding strategy, and it does help you understand how your time management and focus works while you’re programming, where you got stuck, etc. So for that reason I think this is a really useful exercise.


You must still finish these programs as part of the assignment. There is no autograder for them released while the assignment is out; we will grade them manually after the deadline. Come ask for help in tutor hours (help sessions) if you need help finishing them! We do ask that you spend at least one 30-minute session with notes before coming to help sessions on PA6, and we might ask to see your notes for a sense of your progress when you come.


Export your notes document as a PDF using Google Docs (under the File menu). You’ll hand it in under the pa6-notes assignment on Gradescope.

You’ll hand in the two .java files with your completed tasks to the pa6-code assignment on Gradescope.

Challenges and Extra Practice

If you want more practice or an extra challenge, try writing the programs below. These are not for credit, but feel free to ask us about them on Piazza if you found them interesting!


  1. You only need to finish/submit 2 of the 4 tasks, and pa6-code assignment on Gradescope is due on the same day as pa6-notes (August 25th).

  2. Q: In, is the number of values that we average over all the numbers passed as command line arguments or just the positive numbers?

    • A: We are only considering positive numbers. So for both the total and the count they should only be of the positive numbers.