4 another representation defines a jar as a linked

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

View Full Document Right Arrow Icon
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. F ILE 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
Image of page 2

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

View Full Document Right Arrow Icon
T ESTING 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 void writeJarToFile(VectorJar& J1, string fileName) 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 void readJarFromFile(VectorJar& J2, string fileName) 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.
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern