1 / 15

Programming Assignment 1: DVD Inventory Management System

This programming project involves implementing a DVD inventory management system using C++. The system should allow for managing movie titles, tracking DVD quantities, and maintaining wait lists for sold-out titles.

melissao
Download Presentation

Programming Assignment 1: DVD Inventory Management System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Programming Assignment 1:DVD Inventory Management System Chien Chin Chen Department of Information Management National Taiwan University

  2. Task • The goal of this programming project is to implement a DVD inventory management system. • You are asked to write a C++ program that implements the DVD inventory management system as described in the textbook, pp. 221-227. • With some modifications.

  3. System Requirements (1/4) • Define an ADT inventory. (you may want to use the data structures as suggested in Figure 4-33) • The inventory consists of a list of movie titles. • Each movie title has the following information: • Title. • Have value: number of DVDs currently in stock. • Want value: number of DVDs that should be in stock. • Wait list: list of names of people waiting for the title if it is sold out. • Example: • Title: StarWar. • Have value: 3. • Want value: 6. • Wait list: Eric, John, and Mary.

  4. System Requirements (2/4) • MUST use (write) a linked list to store the move titles in your program. • Additionally, MUST use (write) another type of linked lists to store the wait lists of move titles. title list … … Wait list

  5. System Requirements (3/4) • Maintain the inventory in ALPHABETICALorder(ascending) by title. • Use sequential search for finding an inventory item associated with a title. • When a title is sold out, you must add new names to the end of a title’s wait list. • First-in, first out.

  6. System Requirements (4/4) • MUST use (write) a linked list to store the orders of movie titles in your program. • Delete people from the beginning of the wait list when new DVDs are available (order delivered). order list … Wait list Wait list

  7. Program Input & output (1/3) • Input: • An input file that contains a previously saved inventory and order information. • A transaction file that contains commands(with arguments) to inquire or modify the inventory of the system. • %> inventory_system input_filetransaction_file • Your main program SHOULD receive parameters from the command line. int main(int argc, char * argv[]) { // arvg[1] = the string of input_file // argv[2] = the string of transaction_file ... }

  8. Program Input & output (2/3) • Output: • A file that contains the updated inventory and order information. • Filename: dvd_inventory.txt • File format of input_file (or output dvd_inventory.txt) Part I: DVD inventory inventory StarWar 3 6 Eric John Mary StarTrek 2 1 BeforeSunset 4 6 Mike Jubilee order StarWar 2 BeforeSunset 1 title, have, want, wait list title, order quantity Part II: DVD orders

  9. Program Input & output (3/3) • %> inventory_system input_file transaction_file • Your program first reads the content in the input_file to restore the DVD inventory and order information. • Then, read the commands in the transaction_file to manage the DVD inventory. • Each line of the transaction_file indicates a command for the inventory system. A Matrix 10 S Matrix John Q Add 10 ‘matrix’ into the inventory Sell one ‘Matrix’ to customer John transaction_file Quit and save the inventory, wait lists, and order information into dvd_inventory.txt

  10. Commands & Arguments (1/2) • Commands:

  11. Commands & Arguments (2/2)

  12. Sample Test Data • Sample tests can be accessed at https://datastructure.im.ntu.edu.tw and https://dsassignment.im.ntu.edu.tw. • Included: input files, transaction files, and correct outputs.

  13. Submission (1/2) • A hard copy of a .doc document clearly describing your design and implementation of the program (with some important codes if needed) should be submitted in the class of November 26, 2007. • The assignment submission requirements can be found at https://datastructure.im.ntu.edu.tw/Homework_Requirements.pdf, • The submission instruction can be found at https://datastructure.im.ntu.edu.tw/Web_Introduction.pdf. • A grading program is also provided for students’ reference at https://datastructure.im.ntu.edu.tw/how_to_score_your_program.pdf.

  14. Submission (2/2) • The submission websites will be closed at 11pm, November 25, 2007. Please make sure to submit your assignment before the deadline. • WARNING: Students who copy other's program get zero point from this assignment and their names will be made known to the department.

  15. Useful References • https://datastructure.im.ntu.edu.tw/ • How to upload the assignment. • How to program on Linux. • How to use vi editor. • … • Teaching assistants: • 宋雲喬, r96725014@ntu.edu.tw • 吳昌桓, r96725022@ntu.edu.tw • 林昕彥, r96725034@ntu.edu.tw

More Related