This lab is due by Friday, March 20, 2026, Before Class.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.
Jump To: · Rubric · Submission ·
We'll now expand the capabilities of our existing Warehouse example. Instead of a Box being able to store only doubles, we'll want to be able to store an instance of any type of thing. Download the templated warehouse starter pack. The program will not be able to build out of the box.
The Warehouse class currently stores only a vector of Boxes of doubles. The Box class needs
to be properly refactored to be a templated class. The Box can store an instance
of any type. The Warehouse will likewise retrieve the corresponding instance of any type.
The expected output of the completed program is below:
Made Warehouse H with 2 boxes
Warehouse H has 2 items (4, 2)
Setting Box 0 to size 5
Warehouse H has 2 items (5, 2)
Made Warehouse C with 3 strings
Warehouse C has 3 items (This, Is, template)
Manipulating strings 1 and 2
Warehouse C has 3 items (This, is, templated.)
main.cpp should not be edited as it demonstrates the intended usage of the classes.
Grading Rubric
As this is an introductory C++ course that teaches the fundamental concepts of the language and implementation details of each algorithm, the use of the C++ algorithm library, lambda functions, structured bindings, and smart pointers are prohibited. The use of auto is also discouraged to be aware of the explicit type of every variable used throughout your program.
Your submission will be graded according to the following rubric:
| Points | Requirement Description |
| 0.70 | Fully meets specifications |
| 0.15 | Submitted correctly by Friday, March 20, 2026, Before Class |
| 0.15 | Best Practices and Style Guide followed |
| 1.00 | Total Points |
Lab Submission
Always, always, ALWAYS update the header comments at the top of your main.cpp file. And if you ever get stuck, remember that there is LOTS of help available.
Zip together your main.cpp, Box.hpp, Makefile, Warehouse.hpp file(s) and name the zip file L4B_USERNAME.zip where USERNAME is your user id. Upload this zip file to Canvas under L4B.
After submitting to Canvas, download your submission to ensure your submission is correct and complete. Submissions that are empty or contain only the starter code will not be considered.
This lab is due by Friday, March 20, 2026, Before Class.
As with all labs you may, and are encouraged, to pair program a solution to this lab. If you choose to pair program a solution, be sure that you individually understand how to generate the correct solution.