Object Oriented Programming coursework from Stanford's CS108 curriculum.
This was completed as part of my university coursework at Free University of Tbilisi, following the CS108 curriculum originally developed at Stanford.
See the assignment PDF for detailed explanation and implementation requirements.
This project implements the two parts:
- Part A - Sudoku solver & GUI that applies recursive backtracking with spot-order heuristics and exposes both a programmatic API and a Swing front end.
- Part B - Metropolises database explorer that lets a user add/query a MySQL table via a JTable powered by a custom
AbstractTableModel.
sudoku_A/– core solver (Sudoku), Swing UI (SudokuFrame) and unit tests.database_B/– database model (Metropolis), DAO layer, table model, Swing UI (MetropolisFrame), DAO tests and starter SQL.
- Java 8+ for all application logic, unit tests and Swing GUIs.
- Swing (
javax.swing,java.awt) for both desktop interfaces. - MySQL as the relational datastore for the metropolises client.
- JDBC + MySQL Connector/J for database connectivity.
- Apache Commons DBCP2/Pool2 and Commons Logging for connection pooling and logging.
- JUnit 3 (
junit.framework.TestCase) for automated tests.
Sudoku: encapsulates a puzzle grid, exposes constructors fromint[][]or text and implementssolve(),getSolutionText(),getElapsed()andtoString().Sudoku.Spot: inner class that models each empty cell, computes legal values on demand and enables the “most constrained first” heuristic by exposingnumPossibleValues().SudokuFrame: small Swing app with dual text areas (puzzle + solution), aCheckbutton and an “Auto Check” toggle wired through aDocumentListener.
Metropolis: simple POJO used by both the DAO and the table model.MetropolisesDAO: wraps aBasicDataSourceto issue parameterized INSERT/SELECT statements based on UI criteria (population comparison + exact/partial matches).MetropolisesTable: customAbstractTableModelthat owns the DAO, exposessearch(...)andadd(...)and notifies theJTableviafireTableDataChanged().
sudoku_A/SudokuTest.javauses JUnit to cover solving, elapsed time tracking and grid parsing.database_B/MetropolisesTest.javaspins up a dedicated MySQL schema (metropolises_test) to verify DAO add/search logic under several scenarios.