{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Virtual void differenceconst jar jar1 const jar jar20

Info iconThis preview shows pages 2–3. Sign up to view the full content.

View Full Document Right Arrow Icon
virtual void difference(const Jar& jar1, const Jar& jar2)=0; 3. Write a class VectorJar which implements all functions listed in the class Jar . This representation defines a jar as a vector that can be automatically expanded dynamically as it is necessary, using C++ class vector . 4. Another representation defines a jar as a linked list using the C++ library class list and it will be given to you. You need to work with this code to eliminate run-time errors and/or logical errors with the help of a debugger (gdb or Visual Studio). You need to fix all the bugs, and describe them in your report. 5. Provide results of your tests for both the implementations. FILE NAMES Use these file names (unless you have a good excuse to name them differently): 1. marble.h – the class Marble 2. marble.cpp – implementation of the class Marble 3. jar.h – the abstract class Jar containing all the virtual functions 4. vector_jar.h – the class VectorJar 5. vector_jar.cpp – implementation of the class VectorJar 6. llist_jar.h – the class LListJar (this file will be given) 7. llist_jar.cpp – implementation of the class LListJar (this file will be given) 8. jar_test.cpp – a file containing the main function and test functions. 9. (optional) jar_main.cpp – if you want to keep the main function separate, put it in this file 10. Makefile – use this file to compile your code. 2
Background image of page 2

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
TESTING In order to have a uniform testing scheme we require all of you to have the same user interface to the program. We expect the behavior of the various set operations to be the same for everyone. Therefore, make sure you write these functions to print the contents of a jar object to a file as well as read one from a file 1. Add a function to your test file. This function should take a jar object you want to print out and the file name as arguments. For example, if a jar contains two marbles (red, large) and (green, small), the file would contain the following two lines: r l g s 2. Similarly add a function to read in the file you just wrote. 3. You can test all the operations by using three jars. Use the following menu function for your testing.
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page2 / 3

virtual void differenceconst Jar jar1 const Jar jar20 3...

This preview shows document pages 2 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online