Project

CS2315 Algorithms

Author

Yike Zhang

Published

August 11, 2026

Every topic in the following list is fun and scenario-based, and make sure to program them in standard C++. If you have additional topic suggestions or project ideas, please do not hesitate to discuss them with the instructor first so the instructor can consider adding them to the list for other students to select as well. Make sure to notify the instructor before week 14, so the instructor has enough time to review your proposals and make an announcement for the class regarding any updates.

Each topic below includes an Example Output showing one possible design. These examples are provided to help you picture a working approach. They are suggestions only: your program’s wording, layout, and features do not need to match them. Be CREATIVE!

TipWhat Makes a Good Project
  • Your program compiles and runs with standard C++ (no crashes on normal input).
  • You complete all the required tasks for your chosen topic. The optional task does not affect your final score.
  • You can explain your code during the presentation: how it works and what the specific line of code means.
  • You can interpret the results of your program and show the user interaction.
  • Have fun with it! Add your own perspectives or additional features.

Available Topics

1. Hangman Word Rescue

In this project you will build the classic word-guessing game Hangman. The program picks a secret word, and the player uncovers it one letter at a time while each wrong guess adds another piece to the hangman drawing. This is a great choice if you want practice with strings, loops, and managing game state.

Expectations:

  • Store a list of at least 10 secret words and pick one at random
  • Show the word as blanks and reveal letters as they are guessed correctly
  • Track wrong guesses and draw the hangman figure in ASCII art stage by stage
  • End the game with a win or lose message and reveal the word
  • (Optional) Let the player guess the whole word at once: sort your word list with a sorting algorithm you implement yourself, then use binary search to check whether the guess is a real word from the list

Example Output (Suggestion only, not a requirement to match):

=== Hangman ===
The secret word has 6 letters: _ _ _ _ _ _

Enter a letter: a
Good guess! The word so far: _ a _ a _ a
Enter a letter: t
Sorry, no 't'. Wrong guesses: 1 of 6
   +---+
   |   |
   O   |
       |
=========
Enter a letter: n
Good guess! The word so far: _ a n a n a
Enter a letter: b
Good guess! The word so far: b a n a n a
You win! The word was BANANA.
Total wrong guesses: 1

2. Tic-Tac-Toe Rivalry

This project asks you to build a two-player Tic-Tac-Toe game that runs entirely in the terminal. The program acts as the referee: it draws the board, alternates turns between the two players, rejects illegal moves, and announces the winner or a tie. It is a good fit if you enjoy working with grids and careful condition checking.

Expectations:

  • Display a 3x3 board that updates after every move
  • Let two players take turns placing X and O by choosing a position
  • Reject moves on occupied squares and ask again
  • Detect wins in all rows, columns, and diagonals, plus ties
  • (Optional) Add an unbeatable computer opponent that uses recursion (the minimax idea) to explore every possible future board before choosing its move

Example Output (Suggestion only, not a requirement to match):

=== Tic-Tac-Toe ===
 1 | 2 | 3
-----------
 4 | 5 | 6
-----------
 7 | 8 | 9

Player X, choose a square (1-9): 5
 1 | 2 | 3
-----------
 4 | X | 6
-----------
 7 | 8 | 9

Player O, choose a square (1-9): 5
That square is taken. Try again: 1
 O | 2 | 3
-----------
 4 | X | 6
-----------
 7 | 8 | 9
...
Player X wins!
 O | O | X
-----------
 4 | X | 6
-----------
 X | 8 | 9

3. The Coffee Shop Cashier

Here you will write a simple point-of-sale system for a campus coffee shop. The program presents a menu, takes a customer’s order item by item, applies any discount, and prints a clean, itemized receipt. Choose this one for practice with structured data, arithmetic on money, and formatted output.

Expectations:

  • Display a menu of at least 6 drinks and snacks with prices
  • Let the customer order multiple items with quantities
  • Apply a 10% student discount when the customer shows a student ID
  • Print a nicely formatted receipt with subtotal, tax, and total
  • (Optional) Simulate the morning rush with a queue: customers join the line, orders are taken first come first served, and the display shows who is up next

Example Output (Suggestion only, not a requirement to match):

=== Campus Coffee Shop ===
1. Latte           $4.50
2. Americano       $3.25
3. Hot Chocolate   $3.75
4. Bagel           $2.50
5. Muffin          $3.00
6. Croissant       $3.50

Enter item number (0 to finish): 1
Quantity: 2
Enter item number (0 to finish): 5
Quantity: 1
Enter item number (0 to finish): 0
Student ID discount? (y/n): y

--------- RECEIPT ---------
Latte           x2    $9.00
Muffin          x1    $3.00
Subtotal             $12.00
Student discount     -$1.20
Tax (8.25%)           $0.89
TOTAL                $11.69
---------------------------
Thank you! Have a great day!

4. Grocery List Organizer

This project is a categorized grocery list manager. The user adds items with a quantity and a store category, views the list grouped by category to match the store layout, and checks items off while shopping. It is a solid choice for practicing menu-driven programs, vectors of structs, and organizing data for display.

Expectations:

  • Let the user add items with a name, quantity, and store category (produce, dairy, snacks, etc.)
  • Display the full list grouped by category so it matches the store layout
  • Let the user check off items while “shopping” and remove them from the list
  • Show a summary of what was bought and what was forgotten
  • (Optional) Alphabetize the items within each category using a selection sort or insertion sort that you implement yourself (no library sort allowed)

Example Output (Suggestion only, not a requirement to match):

=== Grocery List Organizer ===
1. Add item  2. View list  3. Check off item  4. Summary  5. Quit
Choice: 1
Item name: milk
Quantity: 1
Category (produce/dairy/snacks/other): dairy
Added!

Choice: 2
--- PRODUCE ---
  [ ] apples (x6)
--- DAIRY ---
  [ ] milk (x1)
  [x] yogurt (x4)
--- SNACKS ---
  [ ] pretzels (x2)

Choice: 4
Bought: 1 item   Still needed: 3 items
Don't forget the milk!

5. Weather Station Logger

In this project you will build a logger that records a week of weather readings and analyzes them. The program stores each day’s temperature, humidity, and conditions, then reports the data in a table along with statistics and a short trend summary. Pick this one if working with data tables and summary statistics appeals to you.

Expectations:

  • Let the user enter daily readings: temperature, humidity, and conditions
  • Store a week of readings and display them in a formatted table
  • Compute statistics: highest, lowest, and average temperature
  • Detect trends and print a forecast-style summary (“warming up this week!”)
  • (Optional) Find the hottest and coldest days with a divide and conquer approach: a recursive function that splits the readings in half and combines the results

Example Output (Suggestion only, not a requirement to match):

=== Weather Station Logger ===
Day 1 - Temperature (F): 71
Day 1 - Humidity (%): 45
Day 1 - Conditions: sunny
... (Days 2 through 7) ...

Day  Temp(F)  Humidity  Conditions
 1     71       45%     sunny
 2     74       50%     sunny
 3     78       62%     cloudy
 4     80       70%     rainy
 5     77       65%     cloudy
 6     73       48%     sunny
 7     75       52%     sunny

High: 80 (Day 4)   Low: 71 (Day 1)   Average: 75.4
Trend: temperatures rose mid-week, then cooled slightly.

6. Secret Message Encoder

This project implements the Caesar cipher, one of the oldest known encryption methods. The program encodes and decodes messages by shifting each letter through the alphabet by a secret amount, while leaving spaces and punctuation unchanged. It is a good match if you want practice with character arithmetic and string processing.

Expectations:

  • Encode a message by shifting each letter by a secret number (Caesar cipher)
  • Decode a message when given the correct shift value
  • Preserve spaces and punctuation, and handle both uppercase and lowercase letters
  • Let the user encode and decode as many messages as they want in one session
  • (Optional) Add a “crack the code” mode that breaks a message without knowing the shift: try all 25 shifts and use letter frequency analysis (how often E, T, and A appear in English) to rank the most likely answer

Example Output (Suggestion only, not a requirement to match):

=== Secret Message Encoder ===
1. Encode  2. Decode  3. Quit
Choice: 1
Message: Meet me at noon!
Shift (1-25): 3
Encoded: Phhw ph dw qrrq!

Choice: 2
Message: Phhw ph dw qrrq!
Shift (1-25): 3
Decoded: Meet me at noon!

Choice: 3
Goodbye!

7. Restaurant Review Tracker

For this project you will build a small review tracker that stores restaurants along with a cuisine type, price level, and star rating. The program lists entries sorted by rating, filters them by cuisine or price, and makes recommendations. Choose it for practice with sorting, searching, and records with multiple fields.

Expectations:

  • Add restaurants with a name, cuisine type, price level, and star rating (1 to 5)
  • List all restaurants sorted from highest to lowest rating
  • Search and filter by cuisine or price level
  • Recommend a spot: “best cheap eats” or a random pick above 4 stars
  • (Optional) Implement the rating sort yourself with insertion sort, and use binary search on the alphabetized restaurant names to look up a restaurant quickly

Example Output (Suggestion only, not a requirement to match):

=== FiveStars Review Tracker ===
1. Add restaurant  2. List by rating  3. Filter  4. Recommend  5. Quit
Choice: 1
Name: Taco Palace
Cuisine: Mexican
Price ($, $$, $$$): $
Rating (1-5): 5
Added!

Choice: 2
5.0  Taco Palace    Mexican   $
4.5  Noodle House   Chinese   $$
4.0  Pasta Roma     Italian   $$$
3.0  Burger Barn    American  $$

Choice: 4
Best cheap eats: Taco Palace (5.0 stars, $)

Questions?

If you are unsure which topic to pick or want to propose a twist on one of these scenarios, bring your questions to the Final Review and Project Q&A session in week 16, or stop by office hours. Happy coding!