Assignment 1a β Introduction¶
School of Engineering and Technology, University of Washington Tacoma
TCSS 305 Programming Practicum, Winter 2026
Value: 4% of the course grade
Due Date
Sunday, 11 January 2026, 23:59:59
π Description¶
You will turn in a short Java program (as an IntelliJ project) to demonstrate that your programming environment setup was successful and to show that you are able to submit your work using Git and GitHub.
This assignment is the first step toward building a UW Bookstore shopping cart application that you will develop in the first 3-4 weeks of the quarter.
π― Learning Objectives¶
By completing this assignment, you will:
- Set up and configure your Java development environment (JDK 25, IntelliJ IDEA)
- Practice using Git and GitHub for version control and submission
- Implement a Java class from an interface specification
- Apply defensive coding techniques (input validation, exception handling)
- Work with
BigDecimalfor precise monetary calculations - Use IntelliJ's code analysis tools to maintain code quality
β Before You Begin¶
Guide
Ensure you have completed the environment setup:
- Installed JDK 25
- Installed IntelliJ IDEA (Ultimate)
- Created a GitHub account linked to your UW email
- Installed Checkstyle-IDEA plugin
π¦ Project Setup¶
This project uses GitHub Classroom to distribute starter code and collect submissions.
Accept the Assignment¶
GitHub Classroom Assignment
- Click the GitHub Classroom assignment link provided by your instructor.
- First time only: GitHub Classroom will ask you to select your name from the course roster. This links your UW identity to your GitHub username. Select carefullyβthis cannot be changed later.
- Click Accept this assignment. GitHub creates a personal repository for you (e.g.,
TCSS305-a1a-yourGitHubUsername). - Wait for the repository to be created (this may take a moment).
- Click the link to your new repository, then click the green Code button and copy the HTTPS URL.
Clone the Repository in IntelliJ¶
- Open IntelliJ IDEA.
- If a project is already open: File β New β Project from Version Control If on the Welcome screen: Get from VCS
- Paste the repository URL you copied.
- Choose a location on your computer for the project files.
- Click Clone.
- When prompted, click Trust Project to allow IntelliJ to load the project configuration.
Troubleshooting IntelliJ + GitHub Authentication
If IntelliJ prompts for credentials or shows authentication errors, try one of these solutions:
Option A: Personal Access Token (Recommended)
Step 1: Generate a Token on GitHub
- Ensure you are logged into GitHub with the account you used for GitHub Classroom
- Go to GitHub Token Settings
- Click Generate new token β Generate new token (classic)
- Add a note (e.g., "IntelliJ TCSS 305")
- Under Select scopes, check:
repo(full repository access)read:org(read organization data)
- π© Click Generate token and copy it immediately β you won't see it again!
Step 2: Configure IntelliJ
- Go to Settings β Version Control β GitHub
- Remove any existing account that isn't working
- Click + β Log In with Token
- Paste your token and click Log In
Caution
Treat your token like a password. Never share it or commit it to a repository.
Option B: GitHub Desktop
Use GitHub Desktop for cloning and pushing. IntelliJ handles everything else.
Setup:
- Install GitHub Desktop and sign in with your GitHub account
- On your repository page, click Code β Open with GitHub Desktop
- Choose a local path and click Clone
- In IntelliJ: File β Open and select the cloned folder
Workflow:
| Operation | Tool | Needs GitHub Auth? |
|---|---|---|
| Clone | GitHub Desktop | Yes |
| Edit code | IntelliJ | No |
| Commit | IntelliJ (Git β Commit) | No |
| Push | GitHub Desktop | Yes |
Commit as often as you like in IntelliJ. When ready to submit, open GitHub Desktop and click Push origin.
Guide
Git Version Control β New to Git? Start here.
Guide
IDE Basics β First time using IntelliJ? Start here.
π Project Structure¶
TCSS305-a1a/
βββ src/ β Source code
β βββ edu/uw/tcss/
β βββ app/
β β βββ StarterApplication.java
β βββ model/
β β βββ Item.java (interface - provided)
β β βββ StoreItem.java (implement this)
β βββ WRONG/ (delete after verification)
β βββ checkstyleRuleBreaker.java
β βββ InspectionTester.java
βββ test/ β Unit tests
β βββ edu/uw/tcss/model/
β βββ StoreItemTest.java (provided tests)
βββ .idea/ β IntelliJ settings (do not edit)
βββ README.md β Links to assignment on course site
βββ executive-summary.md β Your submission notes
Understanding the Layout¶
Source and Test Folders
IntelliJ separates production code (src/) from test code (test/). This is standard practice in professional Java development. Both folders mirror the same package structure.
Packages
Java uses packages to organize related classes. The package edu.uw.tcss.model corresponds to the folder path edu/uw/tcss/model/. All classes in this package share the declaration:
Guide
Java Packages β Learn more about how packages organize Java code.
Key Files
| File | Location | Purpose |
|---|---|---|
StarterApplication.java |
src/.../app/ |
Edit with your academic background |
Item.java |
src/.../model/ |
Interface specification (do not modify) |
StoreItem.java |
src/.../model/ |
Implement this class |
checkstyleRuleBreaker.java |
src/.../WRONG/ |
Linting demo (delete after verification) |
InspectionTester.java |
src/.../WRONG/ |
Inspection demo (delete after verification) |
StoreItemTest.java |
test/.../model/ |
Unit tests (do not modify) |
README.md |
project root | Links to assignment on course site |
executive-summary.md |
project root | Document your submission |
Caution
Do not modify Item.java or StoreItemTest.java. Your implementation must work with the provided interface and pass the provided tests.
βοΈ Requirements¶
Requirement 1: Verify Linting Tools¶
Guide
Linters and Code Quality β Why linting matters and how to use these tools.
The WRONG package contains two files with intentional code quality violations. Use these files to verify that your linting tools are installed and configured correctly.
Verify Checkstyle¶
- In the Project panel, navigate to
src/edu/uw/tcss/WRONG/ - Open
checkstyleRuleBreaker.java - Observe the warnings in the editor (yellow highlights, underlines)
- Open the Checkstyle tool window: View β Tool Windows β Checkstyle
- Click Check Current File (or right-click in the editor β Check Current File)
- Confirm that Checkstyle reports many violations
Verify IntelliJ Inspections¶
- Open
InspectionTester.java - Observe the warnings in the editor
- Run Analyze β Inspect Code...
- Select Current File and click OK
- Confirm that IntelliJ reports inspection warnings
Delete the WRONG Package¶
Once you have verified both tools are working:
- Delete
checkstyleRuleBreaker.java - Delete
InspectionTester.java - Delete the
WRONGfolder
Warning
Do not fix the violations in these filesβjust delete them. They exist only to verify your setup.
Requirement 2: StarterApplication.java¶
Guide
Logging β How to use Java's logging framework.
Remove all existing log messages and console output from the class.
Example of log messages to remove
Using the log level info, add a message describing your academic career up to this point:
- What institution did you take 142/143 (programming 1 and 2)?
- When did you complete them?
- Do you have a college degree before starting this program?
- Anything else that you want to share?
Please use multiple calls to the logger object to complete this requirement (i.e., don't smash all of this into one method call).
Requirement 3: StarterApplication.java¶
Guide
- Checkstyle Rules Reference β Look up specific Checkstyle violations
- IntelliJ Inspections Reference β Look up specific IntelliJ warnings
Edit the Java class such that all warnings and errors are corrected. Right-click on the class name in the Project browser window, Analyze β Inspect Code...
Carefully read each warning/error and correct it. If you are unsure what the warning is for or how to fix it, just ask! I will spend some time in lecture during the first weeks discussing different warnings, why they are there, and how to fix them.
Requirement 4: StoreItem.java¶
Guide
Interface Contracts β Understanding what it means to implement an interface.
Complete the implementation of the StoreItem class based on the provided Item interface and the API descriptions below.
Item Interface
The Item interface defines the contract for all items in the store.
Returns the name for this Item.
Returns the unit price for this Item.
Calculates the total price for the given quantity.
Throws: IllegalArgumentException if quantity is negative.
Returns a formatted description suitable for display in a GUI (e.g., "Computer Science Pen, $2.00").
StoreItem Class
The StoreItem class represents a simple item with standard pricing. It implements the Item interface.
Constructor that takes a name and a price.
Returns the name for this StoreItem.
Returns the unit price for this StoreItem.
Returns price Γ quantity.
Throws: IllegalArgumentException if quantity is negative.
Returns the item formatted as name, $price β for example, an item named "Computer Science Pen" with price 2.00 returns Computer Science Pen, $2.00.
Returns a debug-friendly representation such as StoreItem[name='...', price=...].
Note: the exact format of toString is not tested; your output does not need to match this document.
Code Defensively¶
Constructors should test for invalid values and reject bad input immediately.
Throw IllegalArgumentException for:
- price passed to your class is < 0
- name passed to your class is empty
Throw NullPointerException for:
- name passed to your class is null
- price passed to your class is null
Tip
Use Objects.requireNonNull() to check for null values. This method throws NullPointerException automatically if the argument is null.
Working with BigDecimal¶
All monetary values in this project use BigDecimal instead of double to avoid floating-point precision errors.
Caution
Never convert BigDecimal to double or float when performing calculations.
Key BigDecimal operations:
| Operation | Method |
|---|---|
| Multiply | price.multiply(BigDecimal.valueOf(quantity)) |
| Compare | price.compareTo(BigDecimal.ZERO) < 0 |
| Format | NumberFormat.getCurrencyInstance(Locale.US) |
External Resources
Unit Test Cases¶
Guide
Introduction to Unit Testing β What unit tests are and why they matter.
This project enables test driven development. The QA team has provided a set of unit test cases based on the provided API description. Ensure that all test cases pass before submission. If a test case fails, carefully read the reason for the failure and correct your code appropriately. Note, all test cases fail upon initial Git clone. You must implement individual methods in StoreItem for the tests to pass.
To run the test class:
- Open
test > java > edu.uw.tcss.model > StoreItemTest.java - Either click on the play symbol next to the class name or the play button in the top right portion of the IDE UI. Ensure that Current File or StoreItemTest is selected.
Warning
All tests fail when you first clone the project. This is expected! The tests will pass as you implement each method in StoreItem.
Tip
Run tests frequently as you implement each method. This helps you catch issues early and confirms your implementation matches the specification.
Requirement 5: StoreItem.java¶
Edit the Java class such that all warnings and errors are corrected. Right-click on the class name in the Project browser window, Analyze β Inspect Code...
Fixing the warnings and errors will cause you to change your code. Double check that these changes did not introduce defects by re-running the provided test cases.
Requirement 6: Executive Summary¶
Your project includes a file called executive-summary.md. This file documents your project and submission details.
The .md file extension stands for Markdown. Markdown is a markup language used to format plain text. You may already know a markup language β the M in HTML and XML stands for markup. (Note: markup languages are NOT programming languages but instead are tools for formatting text.)
External Resource
Edit the executive-summary.md file to personalize it for your submission. Carefully read all the text found inside of the enclosing square braces []. Remove all this text (and square braces), replacing it with your own specific details about the project.
π Guide Reference¶
| Guide | Description |
|---|---|
| Environment Setup | Installing JDK, IntelliJ, and configuring your development environment |
| IDE Basics | Getting started with IntelliJ IDEA |
| Java Packages | How packages organize Java code |
| Linters and Code Quality | Why linting matters and how to use Checkstyle and IntelliJ Inspections |
| Checkstyle Rules Reference | Look up specific Checkstyle violations and how to fix them |
| IntelliJ Inspections Reference | Look up specific IntelliJ warnings and how to fix them |
| Logging | How to use Java's logging framework |
| Interface Contracts | Understanding what it means to implement an interface |
| Introduction to Unit Testing | What unit tests are and why they matter |
π Submission and Grading¶
Important
Despite the moderately low point value (4% of the course grade), completing this assignment successfully is critical. You will use these tools and techniques for all future assignments.
Submit your work by committing and pushing to your GitHub repository. See the submission steps below.
Please see the rubric in Canvas for a breakdown of the grade for this assignment.
Submitting Your Work¶
When you are ready to submit, commit and push your changes to GitHub:
- In IntelliJ, click Git β Commit.
- Select all changed files and write a descriptive commit message (e.g., "Completed Assignment 1a").
- Click Commit and Push.
- In the Push dialog, click Push.
- Verify your submission: Visit your repository on GitHub.com and confirm your latest changes appear.
Submitting with GitHub Desktop (Option B users only)
If you configured IntelliJ with a Personal Access Token (Option A), you can ignore this β just use Commit and Push as described above.
If you're using GitHub Desktop (Option B), follow these steps:
- In IntelliJ, click Git β Commit (not "Commit and Push") to save your work locally
- Open GitHub Desktop β it will detect your unpushed commits
- Click Push origin
- Verify on GitHub.com that your changes appear
| Operation | Tool |
|---|---|
| Commit | IntelliJ |
| Push | GitHub Desktop |
Your professor has automatic access to your repository through GitHub Classroom. Make sure your final code is pushed before the deadline.
Tip
You can commit and push multiple times before the deadline. Only your final push will be graded.