CSCI 235 Spring 2024 Term Project

Algorithmic Adventures II: Exponential Creature Odyssey

Project 5 - Ingredient Management with Linked Lists

 

 

 

So, most of our Creatures weren't too happy with the MycoMorsels. It may be time to start making something edible to feed the Creatures of the Cavern. In this project you will build the Ingredient struct and the Pantry class that will allow the management of recipes and the crafting of new Ingredients so simple, even our Creatures will be able to whip up the most delicious recipes!!!
tainted stewtainted stew

 

The link to accept the GitHub Classroom assignment can be found on Blackboard

 

This project consists of three tasks:


Some additional resources


Implementation

Work through the tasks sequentially (implement and test). Only move on to a task when you are positive that the previous one has been completed correctly. Remember that the names of classes and methods must exactly match those in this specification (FUNCTION NAMES, PARAMETER TYPES, RETURNS, PRE AND POST CONDITIONS MUST MATCH EXACTLY).

**Remember, you must thoroughly document your code!!!


Task 1: Implement the Ingredient struct

 

Implement the Ingredient struct in Pantry.hpp but outside of the Pantry class definition, as follows:

 

Task 2: Implement the Pantry class as a subclass of LinkedList

We will now organize all the ingredients in a Pantry so that even our Creatures will be able to easily find the ingredients to execute any recipe.

ingredient

 

The Pantry class will store POINTERS to Ingredient objects, and must have the following public member functions:

 

Constructors / Destructors

 

ingredientingredient

Unique Methods

Task 3: Start Crafting Ingredients! - Debugging Help

stew feast

 

You have been provided with the file debug.csv to help test your code for ingredientQuery. This is in addition to the incremental unit-testing you will do for each method you implement.

  • Upon instantiating a Pantry from debug.csv, and running ingredientQuery as follows:

    pantry.ingredientQuery("in1"); std::cout<<std::endl; pantry.ingredientQuery("in2"); std::cout<<std::endl; pantry.ingredientQuery("in3"); std::cout<<std::endl; pantry.ingredientQuery("in4"); std::cout<<std::endl; pantry.ingredientQuery("in5"); std::cout<<std::endl; pantry.ingredientQuery("in6"); std::cout<<std::endl; pantry.ingredientQuery("in7"); std::cout<<std::endl; pantry.ingredientQuery("in8"); You should produce this output. For readability, a new line was printed after each query.

Query: in1 In the pantry (3) UNCRAFTABLE

Query: in2 in2(C) in1(3)

Query: in3 in3(C) in2(C) <- in1(3)

Query: in4 in4(C) in2(C) <- in1(3) in3(C) <- in2(C) <- in1(3)

Query: in5 in5(C) in4(C) <- in2(C) <- in1(3) in3(C) <- in2(C) <- in1(3)

Query: in6 in6(C) in1(3) in5(C) <- in4(C) <- in2(C) <- in1(3) in3(C) <- in2(C) <- in1(3)

Query: in7 UNCRAFTABLE

Query: in8 in8(0) MISSING INGREDIENTS

 


Testing

Although you will no longer submit your test file, you must continue to thoroughly and methodically test your code.

  • Start by stubbing all expected functions. Have all function declarations in the .hpp and stubs for all functions in the .cpp. When submitted as such, your program will compile, although you will fail all tests, since you have not implemented any functions yet. If your program compiles, you will have at least established that all functions have correct name, parameters and return-type.

    • What is a stub? A stub is a dummy implementation that always returns a single value for testing (or has an empty body, if void). Don’t forget to go back and implement the stub!!! If you put the word STUB in a comment, some editors will make it more visible.

  • Now you can start implementing and testing your project, ONE FUNCTION AT A TIME!

  • Write a main() function to test your implementation. Choose the order in which you implement your methods so that you can test incrementally: i.e. implement constructors then accessor functions, then mutator functions.

  • For each class, test each function you implement with all edge cases before you move on to implement the next function. This includes all constructors.

  • Make sure you include all packages and libraries you use.

How to compile with your Makefile:
In terminal, in the same directory as your Makefile and your source files, use the following command

This assumes you did not rename the Makefile and that it is the only one in the current directory.

Grading Rubric

Correctness 80% (distributed across unit testing of your submission)
Documentation 15%
Style and Design 5% (proper naming, modularity, and organization)


Important: You must start working on the projects as soon as they are assigned to detect any problems with submitting your code and to address them with us well before the deadline so that we have time to get back to you before the deadline.

There will be no negotiation about project grades after the submission deadline.


Submission:

We will grade the following :

Pantry.hpp Pantry.cpp

 

Although Gradescope allows multiple submissions, it is not a platform for testing and/or debugging and it should not be used for that. You MUST test and debug your program locally. To help you not rely too much on Gradescope for testing, we will only allow 5 submissions per day. Before submitting to Gradescope you MUST ensure that your program compiles using the provided Makefile and runs correctly on the Linux machines in the labs at Hunter (see detailed instructions on how to upload, compile and run your files in the “Programming Guidelines” document). That is your baseline, if it runs correctly there it will run correctly on Gradescope, and if it does not, you will have the necessary feedback (compiler error messages, debugger or program output) to guide you in debugging, which you don’t have through Gradescope. “But it ran on my machine!” is not a valid argument for a submission that does not compile. Once you have done all the above you submit it to Gradescope.

Due date:

This project is due April 4

No late submissions will be accepted.

Important

You must start working on the projects as soon as they are assigned to detect any problems and to address them with us well before the deadline so that we have time to get back to you before the deadline. There will be no extensions and no negotiation about project grades after the submission deadline.

 


Help

Help is available via drop-in tutoring in Lab 1001B (see website for schedule). You will be able to get help if you start early and go to the lab early. We only have 3 UTAs in the lab, the days leading up to the due date will be crowded and you will not be able to get much help then.

 

Authors: Georgina Woo, Tiziana Ligorio