Skip to content

Project 2: Plan

Objectives

Continue to build on the plan we started in Unit 1 for the Analyzer application.

  1. Polish up the class diagram diagram from unit 1.
  2. Write prep/pseudocode for the DistinctTokenCountsAnalyzer processToken() method.

Read Before You Begin

You must complete this plan before writing any code. If it’s clear that coding started before your plan was finished, you risk not getting credit for this assignment.

  • The purpose of this assignment is to develop your logic and tests before you start coding. This step is critical to your success on the project.

  • You must earn a “MET” on your plan before moving on to the coding portion.

  • If you start coding first and then go back to “retrofit” your plan, you risk not receiving credit for this assignment.

  • When I review your plan, if it’s clear that you’ve already written code before completing it, your plan may be marked Not Yet.

  • Think of this plan as your blueprint—it’s meant to guide your coding, not document what you’ve already built. Taking time now to map out your logic and test cases will save you time and frustration later.


Instructions

Class Diagram

  • Make any updates and corrections to the class diagram from unit 1.
  • Update the class diagram to reflect the new classes, instance variables, and methods for the Analyzer application.

DistinctTokenCountsAnalyzer

Pseudocode

  • Spend some time thinking through what the processToken() method needs to do in the DistinctTokenCountsAnalyzer class.
  • Document the logic in pseudocode.
  • Name the document plan-pseudocode and save the document in the projects/screenshots/project-2/plan directory.
  • IMPORTANT: If your pseudocode is in a .txt file, avoid adding the .txt file extension to the filename. GitHub is configured to ignore .txt files in the upload process, so it should be saved as plan-pseudocode without the extension.

Pseudocode Tests

  • Provide at least two tests of your pseudocode to check your logic.

Examples

Example Pseudocode for how to search for a specific element in an array.

method searchArray(array, target):

FOR each element in array
    IF element equals target
        RETURN element found
    ENDIF
ENDFOR

It's also crucial that we "test" our pseudocode to make sure our logic is sound. Here's how I could test the above pseudocode:

Test searchArray FOUND condition

Send in an array containing: goodbye, hello
Send in target of hello

first time through:
element is goodbye
target is hello

second time through
element is hello
target is hello
return element found

Test searchArray NOT FOUND condition

Send in an array containing: goodbye, cat
Send in target of hello

first time through:
element is goodbye
target is hello

second time through
element is cat
target is hello

More conditions could be tested as well, for example, what if the array is empty!?


Screenshots

Save a screenshot of the updated class diagram in the projects/screenshots/project-2/plan directory as plan-classDiagram.png.


Submit Project Plan

  1. Add, commit, and push!
  2. Verify the screenshot and your pseudocode are visible in GitHub.
  3. Create a new issue in GitHub: "Project 2 plan ready for review".
  4. Click "Submit new issue"

Rubric

All of the following must be satisfied to achieve a "Met" status

  • Demonstrates a thorough understanding of the Project 2 requirements.
  • Plan is shared in a such a way that instructor can understand the design and provide feedback.
  • The class diagram provides the necessary instance variables, and methods.
  • Pseudocode for the processTokens method accurately describes the logic step-by-step.
  • Pseudocode is written in plain English, avoiding specific programming language syntax or code snippets.
  • At least two tests are provided for the processTokens pseudocode.
  • The plan is visible in GitHub with an issue.

Making Corrections

I will provide feedback in the GitHub issue on your project plan. If you received a "not yet", simply make the necessary corrections and reply to the GitHub issue when you are ready for me to reassess your work.