CS 200 Semester Project, Fall 2023

Table of Contents


1. What to turn in

The following items should be included within your Semester Project replit projet…

  • Code: Make sure code is included in your replit project.
    • CODE SHOULD BUILD, at minimum! I'd rather have incomplete code that builds than a mass of "complete" code that doesn't build.
  • Design doc: You should write a Design Document, and have it saved in your replit project as well.
    • Please upload as a PDF file! I only run Linux computers at home, and I don't pay for Microsoft Word, so those files maybe garbled if you give me the MS Word file. :) PDF is better.

1.1. Design document

Your design document should be concise, but contain the following information:

  1. Instructions: Write instructions for core program functionality, written in a way that the client or the client's employees will understand. Make sure to cover all major features.
  2. Citations: If you utilized code from elseware, list sources on the citations page.
  3. Postmortem: Reflect on your work on this program (this is what we do on the software development side). Answer the following questions:
    • What went well?
    • What could have gone better?
    • What steps are you going to take next time (i.e., next project) to help mitigate the issues that you experienced?

1.2. Code features

The requirements of the client for this program will lend itself to utilizing features that we have learned in CS 200. But specifically, your program should include:

  • At least one class defined.
  • At least one vector of class objects.
  • Using a for loop to iterate over the vector of objects.
  • Using a while loop for the program loop.
  • At least one ofstream object to output data to a "report" file (".txt")
  • Variables, if statements, etc. as needed.

In the starter code, a program structure is already given to you:

.
├── Documentation
│   └── insert-your-docs-here.txt
├── main
├── main.cpp
├── Makefile
├── Program.cpp
├── Program.h
├── replit.nix
├── Utilities.cpp
└── Utilities.h
  • main.cpp: This begins the program. You do not need to edit this file.
  • Program.h, Program.cpp: This contains the Program class. This class contains functions for the program's Setup, Cleanup, and various Menus. You can also store program data in Program.h as a private member variable so that it can be used throughout the entire program.
  • Utilities.h, Utilities.cpp: Contains helper functions that you can use in your program.

1.3. User interface and user experience

Program design should be easy to use for someone who has never seen the program before. Some tips:

  • Make sure you tell the user what kind of input you're expecting before using a cin statement.
  • Display confirmation messages when the user is expecting something to change and it changed (or error messages if something went wrong.)
  • Validate user input to make sure they're not selecting something that will crash the program.

2. Client requirements

2.1. Client 1: BookLook - Reading log program

c2_project_client1.png

This client wants a program similar to Goodreads, where the program users can store a list of books that they are reading, want to read, or have finished reading.

User stories / acceptance criteria

Item As a(n)… I want to … So that…
1 As a Program User I want to be able to add a new book to my list So that I can keep track of my books.
2 As a Program User I want to be able to set and edit my reading status So that I can update my progress, and which books to still read.
3 As a Program User I want to be able to export a filtered list of books So that I can view just "to read", or just "reading", or just "finished" books in a list.

Example design

  • Class: There could be a Book class that contains its title, author, a "status", such as "reading", "to read", or "finished", as well as a rating (e.g., 5/5).
  • Vector of Classes: Within the Program class declaration, create a vector of Book items: vector<Book> m_bookList;. Then, this m_bookList can be used throughout the program.

Mockups Your program output doesn't have to match this, but here is an example of what output could look like…

Main menu:

BOOKLOOK

-- MAIN MENU --
1. Add new book
2. Edit existing book
3. Save book list
0. Quit

Save book list:

-- SAVE BOOK LIST --

1. Save all books
2. Save "To Read" books
3. Save "Reading" books
4. Save "Finished" books
0. Go back

>> 1

Saved to "all-books.txt".

File output (after save book):

ALL BOOKS:

#    TITLE          AUTHOR           STATUS
-------------------------------------------------
0    Six of Crows   Leigh Bardugo    Finished
1    Kindred        Octavia Butler   Finished
2    VIC Games      Nick Hampshire   To Read
3    Mismatch       Kat Holmes       To Read
4    Free Culture   L. Lessig        Reading

Add new book:

-- ADD NEW BOOK --

Enter book title:  Rubik
Enter book author: Elizabeth Tan

Enter status:
1. To read
2. Reading
3. Finished

>> 1

New book added.

Edit existing book:

-- EDIT EXISTING BOOK --

ALL BOOKS:

#    TITLE          AUTHOR           STATUS
-------------------------------------------------
0    Six of Crows   Leigh Bardugo    Finished
1    Kindred        Octavia Butler   Finished
2    VIC Games      Nick Hampshire   To Read
3    Mismatch       Kat Holmes       To Read
4    Free Culture   L. Lessig        Reading

Enter ID of book to edit: 2

VIC Games by Nick Hampshire, To Read

1. Update title
2. Update author
3. Update status
0. Go back

>> 3

Change status to...
1. To read
2. Reading
3. Finished

>> 3

Book status updated.


Initial data

At the start of the program (i.e., in Program::Setup()), create a few hard-coded book items here so that there's always data to work with when running the program. You can use the example books listed in the mockups as the starter data.


Modifications

If you'd like to use this same program structure but with a different topic (e.g., storing a list of other products or other items with different "status"es), feel free to change things.


2.2. Client 2: Circlesoft - Monster bestiary

c2_project_client2.png

This client wants a tool that organizes all the data for the monsters in their game, Concluding Chronicle. Their program will store a list of Monsters that will be in the game. Monsters should have a name, a type (e.g., fire, water, earth, air), and basic stats like HP (hit points), attack, and defense.

User stories / acceptance criteria

Item As a(n)… I want to … So that…
1 As a Game Designer I want to create a new monster to the data So that we can keep track of all monsters in the game.
2 As a Game Designer I want to be able to edit existing monsters So that we can balance the game as we go.
3 As a Game Designer I want to be able to export a list of monsters by type So that we can view the lists on paper for meetings.

Example design

  • Class: There could be a Monster class that contains a monster's name, stats (hp, attack, defense), and a "type", like "fire", "water", "earth", "air".
  • Vector of Classes: Within the Program class declaration, create a vector of Monster items: vector<Monster> m_monsterList;. Then, this m_monsterList can be used throughout the program.

Mockups Your program output doesn't have to match this, but here is an example of what output could look like…

Main menu:

MONSTER BESTIARY

-- MAIN MENU --
1. Add new monster
2. Edit existing monster
3. Save monster list
0. Quit

Save monster list:

-- SAVE MONSTER LIST --

1. Save all monstesr
2. Save "fire" type monsters
3. Save "water" type monsters
4. Save "air" type monsters
5. Save "earth" type monsters
0. Go back

>> 1

Saved to "all-monsters.txt".

File output (after save list):

ALL MONSTERS:

#    MONSTER     HP  ATK  DEF  TYPE
-------------------------------------------------
0    Rat         10  2    2    Earth
1    Flytrap     15  3    2    Earth
2    Badkite     20  5    3    Air
3    Hotdog      25  10   5    Fire
4    Sadfish     30  5    10   Water

Add new monster:

-- ADD NEW MONSTER --

Enter monster name: Bad Egg
Enter HP: 25
Enter ATK: 20
Enter DEF: 15

Enter type:
1. Fire type
2. Water type
3. Air type
4. Earth type
0. Go back

>> 1

New monster added.

Edit existing monster:

-- EDIT MONSTER --

ALL MONSTERS:

#    MONSTER     HP  ATK  DEF  TYPE
-------------------------------------------------
0    Rat         10  2    2    Earth
1    Flytrap     15  3    2    Earth
2    Badkite     20  5    3    Air
3    Hotdog      25  10   5    Fire
4    Sadfish     30  5    10   Water

Edit which ID? 1

Flytrap, 10/3/2, Earth type

1. Update name
2. Update HP
3. Update ATK
4. Update DEF
5. Update type
0. Go back

>> 5

Change type to...
1. Fire type
2. Water type
3. Air type
4. Earth type

>> 4

Monster type updated.

Initial data

At the start of the program (i.e., in Program::Setup()), create a few hard-coded monster items here so that there's always data to work with when running the program. You can use the example monsters listed in the mockups as the starter data.


Modifications

If you'd like to use this same program structure but with a different topic (e.g., storing a list of recipes instead of monsters), feel free to change things.


2.3. Client 3: Filmeto Theaters - Point of Sale system

c2_project_client3.png

This client wants customers to be able to pay for movie tickets using a kiosk with a computer program. The kiosk should handle the entire transaction process, such as asking for how many tickets of each type. It should also calculate the order total and "print" out a receipt (i.e., save a text file receipt) once finished.

User stories / acceptance criteria

Item As a(n)… I want to … So that…
1 As a Customer I want to be able to select tickets to purchase So that my family can see a movie together
2 As a Customer I want to be able to edit my order (add/remove tickets) So that I don't pay for tickets I mistakenly added
3 As a Customer I want to receive a receipt when the transaction is complete So that I can record my expenses

Example design

  • Class: There could be a Ticket class that contains the "name" of the ticket type (e.g., "kids", "adults", "seniors"), and the price of each ticket type.
  • Vector of Classes: Within the Program class declaration, create a vector of Ticket items: vector<Ticket> m_ticketList;. Then, this m_ticketList can be used throughout the program.
  • Vector of Classes: Within the program, you can also have a vector of int items, where each int represents one ticket type. This would be used during the creation of a customer's order. For example, if we have tickets like:
Index 0 1 2
Ticket child ticket, $6.50 adult ticket, $8.75 senior ticket, $6.00

Then if the customer wants 3 child tickets and 2 adult tickets, then our order vector might contain { 0, 0, 0, 1, 1 }.


Mockups Your program output doesn't have to match this, but here is an example of what output could look like…

Main menu:

MOVIE TICKET KIOSK

Current order: 0 child tickets, 0 adult tickets, 0 senior tickets

1. Add child ticket ($6.50)
2. Add adult ticket ($8.75)
3. Add senior ticket ($6.00)
4. Remove ticket
0. Complete transaction

Selection: 1

Child ticket added.

Remove ticket:

-- REMOVE TICKET --

Current order:

#   TICKET        PRICE
-----------------------
0   Child ticket  $6.50
1   Child ticket  $6.50
2   Child ticket  $6.50
3   Adult ticket  $8.75
4   Adult ticket  $8.75

Enter ID of ticket to remove: 0

Ticket 0 removed

Complete transaction:

TRANSACTION COMPLETE

See receipt.txt for receipt.

Example receipt.txt:

ORDER

#   TICKET        PRICE
-----------------------
0   Child ticket  $6.50
1   Child ticket  $6.50
2   Child ticket  $6.50
3   Adult ticket  $8.75
4   Adult ticket  $8.75

Subtotal ..... $37.00
Tax .......... 9.1%
Tax amount: .. $3.37

TOTAL: $40.37

Initial data

At the start of the program (i.e., in Program::Setup()), create a few hard-coded ticket items here so that there's always data to work with when running the program. You can use the example ticket listed in the mockups as the starter data.


Modifications

If you'd like to use this same program structure but with a different topic (e.g., purchasing a book instead of a movie ticket), feel free to change things.


3. Cookbook

Remember that the Utilities.h file also contains some useful functions!

We will fill this out more during class.

Program loop:

bool running = true;
while ( running )
{
  // 1. Display menu
  // 2. Get user input
  // 3. Use if/else if statements to
  // do an action based on the input
}
cout << "Goodbye." << endl;

Input validation:

int GetInput( int min, int max )
{
  int choice;
  cout << "Enter choice: ";
  cin >> choice;

  while ( choice < min || choice > max )
  {
    cout << "Invalid, try again: ";
    cin >> choice;
  }

  return choice;
}

Author: Rachel Wil Sha Singh

Created: 2023-11-12 Sun 16:41

Validate