{"id":15744,"date":"2020-11-24T09:12:41","date_gmt":"2020-11-24T09:12:41","guid":{"rendered":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/"},"modified":"2020-11-24T09:12:41","modified_gmt":"2020-11-24T09:12:41","slug":"complete-the-stack-class","status":"publish","type":"post","link":"https:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/","title":{"rendered":"Complete the Stack class"},"content":{"rendered":"<style type=\"text\/css\"><\/style><p>Step 3: Complete the Stack class<br \/>\nThe Stack class implements a templated, linked list-based stack. Complete the class by writing the copy constructor, destructor, and assignment operator. The function prototypes are provided in stack.h. Since the class is templated, the implementation will be done entirely in stack.h; there is no stack.cpp file.<\/p>\n<p>Step 4: Test your code<br \/>\nYou must write a test program called mytest.cpp that checks correctness of the copy constructor and assignment operator. See driver.cpp for an example of how to use the stack class; output from the program is provided in driver.txt.<\/p>\n<p>Following is a list of essential tests; we refer to the stack created by the copy constructor or on the left side of the assignment operator as the new stack; the stack from which the copy is made is the source:<\/p>\n<p>Check that a copy is made. The new stack should contain exactly the same data as the source stack.<br \/>\nCheck that the copy is deep. Modifying either stack (new or source) should not affect the other.<br \/>\nCheck edge cases. For example, do they work correctly if the source stack is empty?<br \/>\nFor the assignment operator, check that you have guarded against self-assignment.<br \/>\nStep 5: Check for memory leaks<br \/>\nRun your test programs using Valgrind. For example, assuming you have compiled mytest.cpp, producting the executable mytest.out, run the command<\/p>\n<p>valgrind mytest.out<br \/>\nIf there are no memory leaks, the end of the output should be similar to the following:<\/p>\n<p>==8613==<br \/>\n==8613== HEAP SUMMARY:<br \/>\n==8613==\u00a0 \u00a0 in use at exit: 0 bytes in 0 blocks<br \/>\n==8613==\u00a0 total heap usage: 14 allocs, 14 frees, 73,888 bytes allocated<br \/>\n==8613==<br \/>\n==8613== All heap blocks were freed \u2014 no leaks are possible<br \/>\n==8613==<br \/>\n==8613== For lists of detected and suppressed errors, rerun with: -s<br \/>\n==8613== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)<br \/>\nThe important parts are in use at exit: 0 bytes and no leaks are possible. The last line is also important as memory errors can lead to leaks.<\/p>\n<p>Step 6: Link your shared directory<br \/>\nDo not complete Steps 6 and 7 until directed to do so by your instructor. The submission directories will not be created until January 31.<\/p>\n<p>Follow the instructions on the Project Submission page to make a symbolic link to the shared directory in your home directory.<\/p>\n<p>Step 7: Submit your files<br \/>\nSee the What to Submit section, below.<\/p>\n<p>Implementation Notes<br \/>\nEach project has a section on implementation notes. These point out some issues that you might encounter while developing your code. You should look through the Implementation Notes before you start coding.<\/p>\n<p>For Project 0, there are only a few notes:<\/p>\n<p>The class declarations (Node and Stack) and provided function implementations in stack.h may not be modified in any way. No additional libraries may be used, but additional using statements are permitted.<br \/>\nThe locations for the function implementations are clearly marked in stack.h. They must be written at the specified locations; in particular, they must not be written in-line.<br \/>\nPrivate helper functions may be used, but must be declared in the private section of the Stack class. There is comment indicating where private helper fuction declarations should be written.<br \/>\nYou should read through the coding standards for this class.<\/p>\n<p>What to Submit<br \/>\nYou must submit the following files to the proj0 submit directory:<\/p>\n<p>stack.h<br \/>\nmytest.cpp<br \/>\nIf you followed the instructions in the Project Submission page to set up your directories, you can submit your code using the following command:<\/p>\n<p>&nbsp;<\/p>\n<p><center><a href=\"http:\/\/onlineclassesguru.com\/orders\/ordernow\"><img decoding=\"async\" src=\"https:\/\/encrypted-tbn0.gstatic.com\/images?q=tbn:ANd9GcTyj99p60XCLyLk1htB7-1neRt8-2QdnenNlQ&usqp=CAU\"target=\"_http:\/\/onlineclassesguru.com\/orders\/ordernow\"\/><\/center><p>","protected":false},"excerpt":{"rendered":"<p>Step 3: Complete the Stack class The Stack class implements a templated, linked list-based stack. Complete the class by writing the copy constructor, destructor, and assignment operator. The function prototypes are provided in stack.h. Since the class is templated, the implementation will be done entirely in stack.h; there is no stack.cpp file. Step 4: Test&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-15744","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v17.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Complete the Stack class - onlineclassesguru<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Complete the Stack class - onlineclassesguru\" \/>\n<meta property=\"og:description\" content=\"Step 3: Complete the Stack class The Stack class implements a templated, linked list-based stack. Complete the class by writing the copy constructor, destructor, and assignment operator. The function prototypes are provided in stack.h. Since the class is templated, the implementation will be done entirely in stack.h; there is no stack.cpp file. Step 4: Test...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/\" \/>\n<meta property=\"og:site_name\" content=\"onlineclassesguru\" \/>\n<meta property=\"article:published_time\" content=\"2020-11-24T09:12:41+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin_admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/onlineclassesguru.com\/#website\",\"url\":\"https:\/\/onlineclassesguru.com\/\",\"name\":\"onlineclassesguru\",\"description\":\"Cheap Professional coursework and reaction papers help\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/onlineclassesguru.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/#webpage\",\"url\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/\",\"name\":\"Complete the Stack class - onlineclassesguru\",\"isPartOf\":{\"@id\":\"https:\/\/onlineclassesguru.com\/#website\"},\"datePublished\":\"2020-11-24T09:12:41+00:00\",\"dateModified\":\"2020-11-24T09:12:41+00:00\",\"author\":{\"@id\":\"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742\"},\"breadcrumb\":{\"@id\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/onlineclassesguru.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Complete the Stack class\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742\",\"name\":\"admin_admin\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/onlineclassesguru.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g\",\"caption\":\"admin_admin\"},\"url\":\"https:\/\/onlineclassesguru.com\/index.php\/author\/admin_admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Complete the Stack class - onlineclassesguru","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/","og_locale":"en_US","og_type":"article","og_title":"Complete the Stack class - onlineclassesguru","og_description":"Step 3: Complete the Stack class The Stack class implements a templated, linked list-based stack. Complete the class by writing the copy constructor, destructor, and assignment operator. The function prototypes are provided in stack.h. Since the class is templated, the implementation will be done entirely in stack.h; there is no stack.cpp file. Step 4: Test...","og_url":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/","og_site_name":"onlineclassesguru","article_published_time":"2020-11-24T09:12:41+00:00","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin_admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/onlineclassesguru.com\/#website","url":"https:\/\/onlineclassesguru.com\/","name":"onlineclassesguru","description":"Cheap Professional coursework and reaction papers help","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/onlineclassesguru.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/#webpage","url":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/","name":"Complete the Stack class - onlineclassesguru","isPartOf":{"@id":"https:\/\/onlineclassesguru.com\/#website"},"datePublished":"2020-11-24T09:12:41+00:00","dateModified":"2020-11-24T09:12:41+00:00","author":{"@id":"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742"},"breadcrumb":{"@id":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/onlineclassesguru.com\/index.php\/2020\/11\/24\/complete-the-stack-class\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/onlineclassesguru.com\/"},{"@type":"ListItem","position":2,"name":"Complete the Stack class"}]},{"@type":"Person","@id":"https:\/\/onlineclassesguru.com\/#\/schema\/person\/1831fa4d28e47b468621cf27932f5742","name":"admin_admin","image":{"@type":"ImageObject","@id":"https:\/\/onlineclassesguru.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/429c8d043f7a770af242b0031e8b9f2b?s=96&d=mm&r=g","caption":"admin_admin"},"url":"https:\/\/onlineclassesguru.com\/index.php\/author\/admin_admin\/"}]}},"_links":{"self":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/posts\/15744"}],"collection":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/comments?post=15744"}],"version-history":[{"count":0,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/posts\/15744\/revisions"}],"wp:attachment":[{"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/media?parent=15744"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/categories?post=15744"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/onlineclassesguru.com\/index.php\/wp-json\/wp\/v2\/tags?post=15744"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}