Question: Question: Problem: Redbox needs a program to track inventory and to generate a report for their DVD rental kiosks. Given a log of transactions including

Question:

Problem: Redbox needs a program to track inventory and to generate a report for their DVD rental kiosks. Given

a log of transactions including renting and returning DVDs as well as adding and removing DVD titles, the program

will need to process each transaction and create a report after all transactions have been processed. The

generated report will list all DVD titles stored in the kiosk as well as how many of each disc are in the kiosk.

Details:

The inventory will be held in a binary search tree that you will create

Use the DVD title to determine node placement in the tree

The binary tree will be seeded with an inventory file

Once seeded, the program will parse a transaction log to update the inventory

There are five possible transactions:

o Add

Add a new title

Create a new node and insert it into the tree

Add copies to an existing title

Find the title in the tree and increase the number of available copies by the

amount listed

o Remove copies of an existing title

Find the title in the tree and reduce the number of available copies by the amount listed

If number available is zero and no copies are rented out, delete the node from the tree

There will not be more copies removed than available.

o Rent a DVD

Reduce available amount of an existing title by one and increase rented amount by one

o Return a DVD

Increase available amount of an existing title by one and reduce rented amount by one

Classes:

Node

o Members

Title (string - case insensitive)

Available (integer)

Rented (integer)

Left (node pointer)

Right (node pointer)

o Methods

Overloaded constructor

Mutators

Accessors

Binary Search Tree

o Binary Search Tree class must use generics (-5 points if not)

o Members

Root (node pointer)

o Methods

Mutator

Accessor

Insert (recursive) (-5 points if not)

Search (recursive) (-5 points if not)

Delete

Other methods that are necessary to interact with a binary search tree

Remember that methods should be generic to be used on a binary tree regardless

of the problem and data type.

User Interface and Input: There is no user interface for this program. Input will be loaded from two files,

inventory.dat and transaction.log. The inventory.dat is assumed to be error free and it will be

read first by your program and loaded into a binary search tree. Each line (except the last line which may not have

a newline character) in inventory.dat will be formatted as follows (NOTE: represents a variable value):

"",<quantity available>, <quantity rented> //May contain space(s) around commas</p> <p>After processing the inventory file, begin processing transaction.log. Each line of the file should follow one</p> <p>of the following formats (Note: Command is case insensitive):</p> <p> aDd "<title>", <number to add> //Command lines may contain space(s) around commas</p> <p> ReMove "<title>",<number to remove></p> <p> rent "<title>"</p> <p> retUrn "<title>"</p> <p>The transaction file may contain errors due to network disruptions from the main server. For each line in the</p> <p>transaction log, validate that it follows one of the formats listed above. If it is the correct format, process the</p> <p>transaction. If the <number to add>, <number to remove>, or the line format is invalid write the line to an error</p> <p>file (as described below). All numbers are expected to be integers. To be valid, the line must follow the format</p> <p>exactly. Also, do not assume that a title in the transaction log will be in the tree.</p> <p>Output: A file named error.log will be created only if any lines of transaction.log are invalid.</p> <p>Error.log will contain all invalid entries of the transaction file.</p> <p>At the end of the program, create a formatted report file that contains each title, the number of copies available</p> <p>to rent for that title as well as the number of copies that are currently rented. The titles should be listed in</p> <p>alphabetical order (without the double quotes). The report should be arranged in three formatted columns that</p> <p>line up the data nicely:</p> <p> Title</p> <p> Copies available</p> <p> Copies rented</p> <p>Title Available Rented</p> <p>-----------------------------------------------------------</p> <p>Collateral Beauty 2 2</p> <p>Doctor Strange 1 2</p> <p>Hacksaw Ridge 0 1</p> <p>Write the report to a file named redbox_kiosk.txt</p> <p> </p> <p>Program Flow:</p> <p> Program starts in main() method</p> <p> Load inventory.dat</p> <p> Create and populate the Binary Search Tree</p> <p> Load transaction.log</p> <p> Process all transactions</p> <p> Output final inventory to file</p> <p>Link - https://drive.google.com/file/d/12gBsfSb-fdXxK_Lary461KYzMNIUfEtw/view?usp=sharing</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 Programming Questions!</h3> <div class="relatedQuestionSliderHolder"> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/this-is-the-question-and-answer-is-below-i-want-17794754" > This is the question and answer is below. I want to convert the code from c++ to java. CS 2336 - PROJECT 4 - Redbox Inventory System Project Due: 11/21 by 11:59 PM KEY ITEMS: Key items are marked in... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/redbox-is-in-need-of-a-program-to-track-inventory-13680046" > Redbox is in need of a program to track inventory and to generate a report for their DVD rental kiosks. Given a log of transactions including renting and returning DVDs as well as adding and removing... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/1-what-are-netflixs-resources-capabilities-and-core-competencies-in-25082903" > 1) What are Netflix's resources, capabilities, and core competencies in this case based on the VRIO framework? 2) Conduct a SWOT analysis based on the case. It's not Netflix that's making the... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/report-format-your-report-should-include-ii-executive-summary-1-27553781" > Report Format: Your report should include: II. Executive Summary (1 page in length). The Executive Summary is a concise overview of the report. The Case Study Report should be written from the... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/case-11-netflix-in-2012-can-it-recover-from-its-10703618" > CASE 11 Netflix in 2012: Can It Recover from Its Strategy Missteps? Arthur A. Thompson The University of Alabama hroughout 2010 and the first six months of 2011, Netflix was on a roll. Movie... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/4-games-by-mailidatabase-development-marks-dsi-has-spent-more-4136031" > 4. Games By MailiDatabase Development MARKS) DSI has spent more than $425,000 to date researching and developing a patented database used to track orders and returns of video games from the Games by... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/answer-the-following-question-using-your-own-words-original-18560967" > Answer the following question using your own words. ( Original work please) Reading will be down below 1: What role will Redbox play in the development of Netflix's strategic plans? How threatening... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/1-how-strong-are-the-competitive-forces-in-the-rapidly-24224158" > 1. How strong are the competitive forces in the rapidly evolving global market for streamed video content? Do a five-forces analysis to support your answer. 2. What forces are driving change in this... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/do-not-mention-blockbuster-how-strong-are-the-competitive-forces-23952017" > Do not mention Blockbuster How strong are the competitive forces in the rapidly evolving global market for streamed video content? Do a five-forces analysis to support your answer. What forces are... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/in-what-ways-did-blockbuster-achieve-better-strategic-fit-than-20990747" > In what ways did Blockbuster achieve better strategic fit than local stores? How much implied uncertainty do Netflix and Redbox face? What levers do they use to deal with this uncertainty? How did... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/jason-trevor-owns-a-commercial-bakery-in-blakely-georgia-that" > Jason Trevor owns a commercial bakery in Blakely, Georgia, that produces a variety of goods sold in grocery stores. Trevor is required by law to perform internal tests on food produced at his plant... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/cathy-company-sells-books-to-the-public-cathys-income-statement-315032" > Cathy Company sells books to the public. Cathy's income statement for the first quarter of the current year is presented below: Sales $600,000 Cost of Goods Sold 420.000 Gross Margin 180,000... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/1-4-lo-3-3-when-fixed-costs-27957412" > 1 4 . LO 3 . 3 When fixed costs increase and all other variables remain unchanged, the contribution margin will _ _ _ _ _ _ _ _ . remain unchanged increase decrease increase variable costs per unit </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/a-company-issues-1050-shares-of-its-common-stock-for-10820281" > A company issues 1,050 shares of its common stock for $33,600 cash. Prepare journal entries to record this event under each of the following separate situations. </a> </div> </div> <nav class="navigationButtons"> <a class="previousQuestionButton" href="/study-help/questions/having-issue-in-regular-expression-in-python-not-getting-desire-17793912">Previous Question</a> <a class="nextQuestionButton" href="/study-help/questions/codea-97b-98c-99d-100your-program-should-do-the-followinghave-17793914">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/app-inventor-1st-edition-9781449397487"> <img src="https://dsd5zvtm8ll6.cloudfront.net/si.question.images/book_images/2022/02/62022964ba0a1_8366202296434d21.jpg" width="100" height="131" alt="App Inventor" loading="lazy" style="width: 100px !important;"> </a> <a href="/textbooks/computer-science-javascript-2443" 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/app-inventor-1st-edition-9781449397487" style="text-align: left;"> App Inventor </a> </span> <div class="bookMetaInfo" style="text-align: left;"> <p class="bookAuthor" style="text-align: left;"> <b>Authors:</b> <span>David Wolber, Hal Abelson</span> </p> <p class="bookEdition" style="text-align: left;"> 1st Edition </p> <p class="bookEdition" style="text-align: left;"> 1449397484, 9781449397487 </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=17793913&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>