Question: You are to create a program that can be used for keeping track of textbooks required and recommended for classes and the cost of those

You are to create a program that can be used for keeping track of textbooks required and recommended for classes and the cost of those textbooks.

All input will be taken from standard input. Each line of input will begin with a single or double character code that identifies the type of operation that line describes. The possible line formats are:

B </p> <p>- Define a book. The ISBN is a 13 digit number. The Title is a string of arbitrary length (ending</p> <p>with a line break).</p> <p>e.g.: B 1234567890123 Programming for Programmers</p> <p>D <isbn> <a e d> <value></p> <p>Define a characteristic of a book (for the book with the given ISBN. If 'A' is used, then the Author is set, and the value is name of the author (string of arbitrary length, ending with end of line). If 'E' is used, the value is the number of the edition (a positive integer). If D is used, it is the date of publication, where the date is in MM/YYTV format (no day). <em>e.g.:</em> D 1234567890123 D 01/2017</p> <p>M <isbn> <cost> <n iuiri e></p> <p>Define the cost for a book. ISBN is the ISBN number, Cost is an amount, expressed as a floating-point number with 2 spaces <em>after</em> the decimal point. The final letter indicates whether the price is for a New, Used, Rented, or Electronic version of the book. A book may have a different price for each format.</p> <p>e.g.: M 1234567890123 39.99 N</p> <p>C <department code> <course number> <name></p> <p>- Define a course. The Department Code is a 4 letter code for a department. The course number is a 3-digit number for the course. The name is a name for the course a string of arbitrary length, ended by the end of the line.</p> <p>e.g.: C CSCE 315 Programming Studio</p> <p>A <isbn> <department code> <course number> <section number> <r i 0></p> <p>Assign a book to a class. The ISBN is the ISBN number for the book. The Department Code and Course number are as in the definition of a course. The section number is a 3 digit integer. The final digit is either R for required or 0 for optional.</p> <p>e.g.: A 1234567890123 CSCE 315 501 R</p> <p>GC <department code> <course number></p> <p>-Print the books required and optional for all sections of a given course</p> <p>GS <department code> <course number> <section number></p> <p>-Print the books required and optional for a given section of a course</p> <p>GB <isbn></p> <p>-Print all information known about a particular book</p> <p>PB</p> <p>-Print a list of all books that are defined</p> <p>PC</p> <p>-Print a list of all courses that are defined</p> <p>PY <mm></p> <p>- Print all books with known publication dates in the given month/year or later.</p> <p>PD <department code></p> <p>- Print the list of all books used in a department, given by department code. Do not list by section.</p> <p>PM <department code></p> <p>Print the AVERAGE minimum and maximum costs of all books in a department. Minimum cost is</p> <p>the cost of the cheapest version of required books for a section. Maximum cost is the cost of</p> <p>the most expensive required and optional books in a course. If a book has no known costs,</p> <p>ignore it. The average is the average across all sections in a department for which there is some</p> <p>required or optional book.</p> <p><strong>Notes:</strong></p> <p><strong>The program should be developed in C++</strong></p> <p>-Books will be defined before details or costs are added</p> <p>-Books and courses will be defined before books are added to courses.</p> <p>-Note that later lines can overwrite information from previous lines. For example, a price could</p> <p>be updated, an edition number could change, etc. The last of the input lines should be the one</p> <p>used.</p> <p>-Printed lists should be reasonably informative, with all information provided possible (e.g. when</p> <p>printing a book, print the title, author (if known), costs (if known), etc.</p> <p> ----------------------------------------------------------------------------------------------------------------------------------------------</p> <p>TEST inputs below can be used to test the programs functionality(Note: this stuff needs to be in a test.txt file and possible run a command such "./main < test.txt" but you can test it your way to.) :</p> <p><strong>TEST data that can be used to test each of the input formats:</strong></p> <p>B 1234567890123 Programming for Pros B 1234567890124 Programming for Dummies B 1234567890125 Programming for Pets D 1234567890123 D 02/2017 D 1234567890123 A King of Stupid D 1234567890123 E 5 D 1234567890124 D 05/2017 D 1234567890124 A Ray D 1234567890124 E 2 D 1234567890125 D 03/2017 D 1234567890125 A James D 1234567890125 E 3 M 1234567890123 1 N M 1234567890123 1 U M 1234567890123 1 R M 1234567890123 1 E M 1234567890124 1 N M 1234567890124 1 U M 1234567890124 1 E M 1234567890124 1 R M 1234567890125 1 N M 1234567890125 1 U M 1234567890125 1 R M 1234567890125 1 E C ECEC 215 Programming Studio C ECEC 111 Unix Testing A 1234567890123 ECEC 215 501 R A 1234567890123 ECEC 215 502 R A 1234567890123 ECEC 215 503 R A 1234567890124 ECEC 213 604 R A 1234567890124 ECEC 213 607 R A 1234567890124 ECEC 213 603 R A 1234567890125 ECEC 215 501 R A 1234567890125 ECEC 215 502 R A 1234567890125 ECEC 215 503 R GC ECEC 215 GS ECEC 215 504 GC ECEC 111 GS ECEC 111 605 GB 1234567890123 GB 1234567890124 GB 1234567890125 PB PC PY 02/2017 PY 05/2017 PD ECEC PM ECEC</p> </div> <div class="question-answer-divider"></div> <section class="answerHolder" itemscope itemtype="http://schema.org/Answer"> <div class="answerHolderHeader"> <h2>Step by Step Solution</h2> <div class="answerReviews"> <div class="starIcon"> </div> </div> </div> <div class="questionProperties"> <p>There are 3 Steps involved in it</p> <div class="cart-flex"> <div class="cart cart1"> 1 Expert Approved Answer </div> </div> </div> <div class="step org_answer"> <span class="view_solution_btn view-solution-btn-cursor"> <strong class="step-heading step-1">Step: 1 <span>Unlock <i class="fa-solid fa-lock"></i></span></strong> </span> <img src="https://www.solutioninn.com/includes/images/document_product_info/blur-text-image.webp" class="blured-ans-image" width="759" height="271" alt="blur-text-image" decoding="async" fetchpriority="high"> <div class="step1Popup"> <span class="heading">Question Has Been Solved by an Expert!</span> <p>Get step-by-step solutions from verified subject matter experts</p> <button class="view_solution_btn step1PopupButton">View Solution</button> </div> </div> <div class="step"> <span class="view_solution_btn view-solution-btn-cursor"> <strong class="accordion step-heading">Step: 2 <span>Unlock <i class="fa-solid fa-lock"></i></span></strong> </span> </div> <div class="step"> <span class="view_solution_btn view-solution-btn-cursor"> <strong class="accordion step-heading">Step: 3 <span>Unlock <i class="fa-solid fa-lock"></i></span></strong> </span> </div> </section> <section class="relatedQuestion"> <h3>Students Have Also Explored These Related Databases Questions!</h3> <div class="relatedQuestionSliderHolder"> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/please-test-it-on-these-inputs-b-1234567890123-programming-for-13308169" > Please test it on these inputs: B 1234567890123 Programming for Pros B 1234567890124 Programming for Dummies B 1234567890125 Programming for Pets D 1234567890123 D 02/2017 D 1234567890123 A King of... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/the-program-that-was-written-below-to-be-used-for-13701701" > The program that was written below to be used for keeping track of textbooks required and recommended for classes and the cost of those textbooks( Heres the link in Chegg for the formats the... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/beck-taxi-by-chandrasekhar-and-krishnamoorthy-it-was-may-25-13961628" > "BECK TAXI" By Chandrasekhar and Krishnamoorthy It was May 25, 2009. Gail Beck Souter, chief executive officer (CEO) of Beck Taxi (Beck), the leading taxi brokerage with the highest number of cabs in... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/programming-assignment-4-required-us-to-write-code-to-convert-17789439" > Programming assignment 4 required us to write code to convert both to and from string records to dictionary items when reading or writing data to a text file. Also, we needed to cast our numbers from... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/a-program-written-in-c-is-being-requested-to-17793614" > [ A PROGRAM WRITTEN IN C IS BEING REQUESTED TO BE WRITTEN FOR MY NOTES TO USE AS REFERENCE IN MY NOTES ] You have been retained by Widget Sales Company (for more information, seeWidget Sales Company... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/mates-rates-rentacar-just-do-the-part-a-using-12688389" > Mates Rates Rent-A-Car ( just do the part a) using visual studio code (C#) Criteria sheet - Par A Example supplementary files (readme.pdf) Example supplementary files (class-diagram.pdf) Assignment... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/architecture-design-describe-three-popular-architecture-options-and-explain-2597690" > Architecture design : describe three popular architecture options and explain which one would best apply to Kuddler. 1,000 words. 1 Service Request SR-kf-013 Paper XXXXXXXXX 2 Service Request... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/303-developing-a-program-philosophy-and-rationale-statement-previous-chapters-1615517" > 303 DEVELOPING A PROGRAM PHILOSOPHY AND RATIONALE STATEMENT Previous chapters have discussed the processes used in developing new courses and improving programs and fields of study. Each of these... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/please-help-with-java-milestone-2-only-java-code-import-12385922" > Please help with Java (Milestone 2 only) Java code: import java.util.*; class Product { String name; int id; float price; Product(Strting name, int id, float price) { // constructor this.name = name;... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/rmit-university-programming-fundamentals-cosc2531-assignment-2-individual-assignment-no-28090019" > RMIT UNIVERSITY Programming Fundamentals (COSC2531) Assignment 2 Individual assignment (no group work). Submit online via Canvas/Assignments/Assignment 2. Marks are awarded per rubric (please see the... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/after-watching-the-15-minute-video-on-jeff-bezos-do-380797" > After watching the 15 minute video on Jeff Bezos, do some additional web-based research on either Bezos himself or Amazon in terms of strategy. In addition, read the article "Taming the Titans" from... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/how-much-wood-is-in-that-tree-for-a-sample-of" > How much wood is in that tree? For a sample of 12 trees the volume of lumber (in cubic meters) and the diameter (in centimeters) at a fixed height above ground level were measured. The results were... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/which-of-the-following-statements-is-correct-group-of-answer-27924637" > Which of the following statements is CORRECT? Group of answer choices Sunk costs were formerly hard to deal with, but once the NPV method came into wide use, it became possible to simply include sunk... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/required-information-the-following-information-applies-to-the-questions-displayed-15222072" > Required information (The following information applies to the questions displayed below.) The following data is provided for Garcon Company and Pepper Company. Beginning finished goods inventory... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/human-resource-information/know-how-to-motivate-and-energize-service-employees-so-that-2125304" > Know how to motivate and energize service employees so that they will deliver service excellence and productivity. </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/human-resource-information/know-how-to-integrate-teams-across-departments-and-functional-areas-2125303" > Know how to integrate teams across departments and functional areas. </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/human-resource-information/understand-why-empowerment-is-so-important-in-many-frontline-jobs-2125301" > Understand why empowerment is so important in many frontline jobs. </a> </div> </div> <nav class="navigationButtons"> <a class="previousQuestionButton" href="/study-help/questions/please-use-string-class-q3-consider-the-following-java-program-13273349">Previous Question</a> <a class="nextQuestionButton" href="/study-help/questions/what-is-data-redundancy-multiple-choice-duplication-of-data-storing-13273351">Next Question</a> </nav> </section> </main> <aside class="expertRight"> <section class="relatedBook" style="margin-bottom:40px; width: 100%;" > <div class="bookHolder" > <div class="relatedBookHeading" > <h2 class="heading">Recommended Textbook</h2> </div> <div class="bookMainInfo" > <div class="bookImage" style="width: 100px !important; min-width: 100px; flex-shrink: 0; margin-right: 20px;"> <a href="/textbooks/put-your-data-to-work-52-tips-and-techniques-for-effectively-managing-your-database-1st-edition-9780880343077"> <img src="https://dsd5zvtm8ll6.cloudfront.net/si.question.images/book_images/6507d974017b5_55002.jpg" width="100" height="131" alt="Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database" loading="lazy" style="width: 100px !important;"> </a> <a href="/textbooks/computer-science-tynker-2513" style="margin-top: 8px; display: block; text-align: left;">More Books</a> </div> <div class="bookInfo" style="text-align: left;"> <span class="bookTitle" style="text-align: left;"> <a href="/textbooks/put-your-data-to-work-52-tips-and-techniques-for-effectively-managing-your-database-1st-edition-9780880343077" style="text-align: left;"> Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database </a> </span> <div class="bookMetaInfo" style="text-align: left;"> <p class="bookAuthor" style="text-align: left;"> <b>Authors:</b> <span>Wes Trochlil</span> </p> <p class="bookEdition" style="text-align: left;"> 1st Edition </p> <p class="bookEdition" style="text-align: left;"> 0880343079, 978-0880343077 </p> </div></div></div> </div> </section> <div class="post-question-section"> <div class="description-question-section"> <span class="post-question-section-title">Ask a Question and Get Instant Help!</span> </div> <div class="text-area-post-question"> <form action="/study-help/post-question?ref=search" method="post" enctype="multipart/form-data"> <textarea rows="4" class="form-control form-posting-margin" name="textarea-question-content" id="textarea-question-content" placeholder="Type Your Question ...."></textarea> <button type="submit" class="btn btn-sm btn-submit-post-question text-center">Get Answer</button> </form> </div> </div> </aside> </div> </div> <div class="promo items-center justify-center hidden"> <div class="app_promo"> <span class="app_promo_dismiss"> <i class="fa-solid fa-x"></i> </span> <div class="app-button"> <div class="image-wrapper"> <img width="30" height="30" src="https://www.solutioninn.com/includes/images/rewamp/common/mobile-app-logo.png" decoding="async" fetchpriority="high" alt="SolutionInn App Logo"> <strong>Study Help</strong> </div> <button class="app_promo_action redirection" data-question-open-url='q_id=13273350&q_type=2'> Open in App </button> </div> </div> </div> </div> </div> <div class="blank-portion"></div> <footer> <div class="container footerHolder"> <div class="footerLinksFlex"> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-6"> <p>Services</p> <ul> <li><a href="/site-map">Sitemap</a></li> <li><a href="/fun/">Fun</a></li> <li><a href="/study-help/definitions">Definitions</a></li> <li><a href="/tutors/become-a-tutor">Become Tutor</a></li> <li><a href="/books/used-textbooks">Used Textbooks</a></li> <li><a href="/study-help/categories">Study Help Categories</a></li> <li><a href="/study-help/latest-questions">Recent Questions</a></li> <li><a href="/study-help/questions-and-answers">Expert Questions</a></li> <li><a href="/clothing">Campus Wear</a></li> <li><a href="/sell-books">Sell Your Books</a></li> </ul> </div> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-6"> <p>Company Info</p> <ul> <li><a href="/security">Security</a></li> <li><a href="/copyrights">Copyrights</a></li> <li><a href="/privacy">Privacy Policy</a></li> <li><a href="/conditions">Terms & Conditions</a></li> <li><a href="/solutioninn-fee">SolutionInn Fee</a></li> <li><a href="/scholarships">Scholarship</a></li> <li><a href="/online-quiz">Online Quiz</a></li> <li><a href="/study-feedback">Give Feedback, Get Rewards</a></li> </ul> </div> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-6"> <p>Get In Touch</p> <ul> <li><a href="/about-us">About Us</a></li> <li><a href="/support">Contact Us</a></li> <li><a href="/career">Career</a></li> <li><a href="/jobs">Jobs</a></li> <li><a href="/support">FAQ</a></li> <li><a href="https://www.studentbeans.com/en-us/us/beansid-connect/hosted/solutioninn" target="_blank" rel="noopener nofollow">Student Discount</a></li> <li><a href="/campus-ambassador-program">Campus Ambassador</a></li> </ul> </div> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-12"> <p>Secure Payment</p> <div class="footerAppDownloadRow"> <div class="downloadLinkHolder"> <img src="https://dsd5zvtm8ll6.cloudfront.net/includes/images/rewamp/common/footer/secure_payment_method.png" class="img-fluid mb-3" width="243" height="28" alt="payment-verified-icon" loading="lazy"> </div> </div> <p>Download Our App</p> <div class="footerAppDownloadRow"> <div class="downloadLinkHolder mobileAppDownload col-md-6 col-lg-6 col-sm-6 col-6 redirection" data-id="1"> <img style="cursor:pointer;" src="https://dsd5zvtm8ll6.cloudfront.net/includes/images/rewamp/home_page/google-play-svg.svg" alt="SolutionInn - Study Help App for Android" width="116" height="40" class="img-fluid mb-3 " loading="lazy"> </div> <div class="downloadLinkHolder mobileAppDownload col-md-6 col-lg-6 col-sm-6 col-6 redirection" data-id="2"> <img style="cursor:pointer;" src="https://dsd5zvtm8ll6.cloudfront.net/includes/images/rewamp/home_page/apple-store-download-icon.svg" alt="SolutionInn - Study Help App for iOS" width="116" height="40" class="img-fluid mb-3" loading="lazy"> </div> </div> </div> </div> </div> <div class="footer-bottom"> <p>© 2026 SolutionInn. All Rights Reserved</p> </div></footer> <script> window.addEventListener("load",function(){jQuery(document).ready(function(t){ // Clarity tracking (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "sjv6tuxsok"); // Helper to read a cookie by name function getCookie(name) { return document.cookie .split('; ') .map(v => v.split('=')) .reduce((acc, [k, val]) => (k === name ? decodeURIComponent(val || '') : acc), ''); } // Read cookies var si = getCookie('si_u_id'); var uid = getCookie('u_id'); var zen = getCookie('zenid'); // Send to Clarity if (si) clarity('set', 'si_u_id', si); if (uid) clarity('set', 'u_id', uid); if (zen) clarity('set', 'zenid', zen); clarity('set', 'ip_address', '216.73.216.134'); t.ajax({type:"POST",url:"/",data:{trackUserActivity:!0,reqUri:document.URL,referer:document.referrer},success:function(t){}})})},!1),window.addEventListener("load",function(){jQuery(document).ready(function(t){t.ajax({type:"POST",url:"/",data:{insertCrawler:!0,reqUri:document.URL,parseTime:"0.056",queryTime:"0.01654768548584",queryCount:"30"},success:function(t){}})})},!1),window.addEventListener("load",function(){jQuery(document).ready(function(){function t(t="",n=!1){var i="itms-apps://itunes.apple.com/app/id6462455425",e="openApp://action?"+t;isAndroid()?(setTimeout(function(){return window.location="market://details?id=com.solutioninn.studyhelp",!1},25),window.location=e):isIOS()?(setTimeout(function(){return window.location=i,!1},25),window.location=e):(i="https://apps.apple.com/in/app/id6462455425",n&&(i="https://play.google.com/store/apps/details?id=com.solutioninn.studyhelp"),window.open("about:blank","_blank").location.href=i)}jQuery("#appModal").modal("show"),jQuery(".download-app-btn").click(function(){t(jQuery(this).attr("data-question-open-url"))}),jQuery(".redirection").click(function(){var n=jQuery(this).attr("data-question-open-url"),i=jQuery(this).attr("data-id");void 0!=n?1==i?t(n,!0):t(n,!1):1==i?t("",!0):t("",!1)}),jQuery(".app-notification-close").click(function(){jQuery(".app-notification-section").css("visibility","hidden");var t=new FormData;t.append("hide_notification",!0),jQuery.ajax({type:"POST",url:"/",data:t,cache:!1,contentType:!1,processData:!1,beforeSend:function(){},success:function(t){location.reload()}})})})},!1); </script> </body> </html>