Ask a question from expert

Ask now

Grocery Store Inventory System: Assignment

43 Pages13942 Words546 Views
   

Added on  2019-09-16

Grocery Store Inventory System: Assignment

   Added on 2019-09-16

BookmarkShareRelated Documents
1Fall 2016. Grocery Store Inventory SystemFile IO and Final assemblyIPC44 Project (Milestone 5, Due Fri Dec 9th23:59, see project webpage)(V1.1, corrected the datefile definitions and added comments.txt to OPEN submission)In a grocery store, in order to be able to always have the proper number of items available on shelves, an inventory system is needed to keep track of items available in the inventory and make sure the quantity of the items does not fall below a specific count.Your job for this project is to prepare an application that manages the inventory of items needed for a grocery store. The application should be able to keep track of the following information about an item:1-The SKU number2-The name (maximum of 20 chars)3-Quantity (On hand quantity currently available in the inventory)4-Minimum Quantity (if the quantity of the item falls less than or equal to this value, a warning should be generated)5-Price of the item6-Is the item TaxedThis application must be able to do the following tasks:1-Print a detailed list of all the items in the inventory 2-Search and display an item by its SKU number3-Checkout an item to be delivered to the shelf for sale4-Add to stock items that are recently purchased for inventory (add to their quantity)5-Add a new item to the inventory or update an already existing item6-Delete an item from the inventory (optional for extra marks)7-Search for an item by its name (optional for extra marks)8-Sort Items by Name (optional for extra marks)PROJECT DEVELOPMENT PROCESSTo make the development of this application fun and easy, the tasks are broken down into several functions that are given to you from very easy ones to more complicated one by the end of the project Since you act like a programmer in this project, you do not need to know the big picture. The professor is your system analyst and designs the system and all its functions to work together inharmony. Each milestone is divided into a few functions. For each function, firstly, understand the goal of the function. Secondly, write the code for it and test it with the tester. Once your
Grocery Store Inventory System: Assignment_1
2code for the function passes the test, set it aside and pick up the next function. Continue until the milestone is complete.The Development process of the project is divided into six milestones and therefore six deliverables. The first five deliverables are mandatory and conclude full submission of the project. The sixth milestone is optional; for those who want to do some extra work for the challenge and the bonus marks. For each deliverable, a tester program (also called a unit test) will be provided to you to test your functions. If the tester works the way it is supposed to do, you can submit that milestone and start the next. The approximate schedule for deliverables is as followsKickoff week 7The UI Tools Due in 10 daysThe Application User InterfaceDue 5 days after UIThe Item IODue 7 days after Application User InterfaceItem Storage and Retrieval in Array Due 10 days after Item IOFile IOand final assemblyDue 5 days after Item Storage (project completed)Item Search by name, delete and sort (optional) 7 days after Project completionFILE STRUCTURE OF THE PROJECTFor each milestone, a source file is provided under the name ipc_msX.c that includes the main()tester program. (Replace X with the milestone number from 1 to 6) The main program acts like a tester (a unit test). Code your functions in this file and test them one by one using the main function provided. You can comment out the parts of the main program for which functions are not developed yet. You are not allowed to change the code in tester. Make sure you do not make any modifications in the tester.MARKING: Please follow this link for marking details: https://scs.senecac.on.ca/~ipc144/dynamic/assignments/Marking_Rubric.pdfMILESTONE 1: THE USER INTERFACE TOOLS (DUE SAT OCT 29TH)Download or Clone milestone 1 from https://github.com/Seneca-144100/IPC_MS1In ipc_ms1.c write the following functions:void welcome(void);Prints the following line and goes to newline>---=== Grocery Inventory System ===---<void prnTitle(void);
Grocery Store Inventory System: Assignment_2
3Prints the following two lines and goes to newline>Row |SKU| Name | Price |Taxed| Qty | Min | Total |Atn<>----+---+--------------------+--------+-----+-----+-----+------------|---<void prnFooter(doublegTotal);Prints the following line and goes to newline>--------------------------------------------------------+----------------<Then if gTotal is greater than zero it will print this line: (assuming gTotal is 1234.57) and go to new line.> Grand Total: | 1234.57<Use this format specifier for printing gTotal :%12.2lfvoid clrKyb(void);“clear Keyboard” Makes sure the keyboard is clear by reading from keyboard character by character until it reads a new line character.Hint: In a loop, keep reading single characters from keyboard until newline character is read ('\n'). Then, exit the loop.void pause(void);Pauses the execution of the application by printing a message and waiting for user to hit<ENTER>.Print the following line and DO NOT go to newline:>Press <ENTER> to continue...<Then, call clrKyb function.Here the clrKyb function is used for a fool-proof <ENTER> key entry.int getInt(void);Gets a valid integer from the keyboard and returns it. If the integer is not valid it will print:"Invalid integer, please try again: "and try again.This function must be fool-proof; it should not let the user pass, unless a valid integer is entered.Hint: to do this, you can have two variables read back to back by scanf; an integer and then a character ("%d%c") and make sure the second (the character) is new line. If the second character is new line, then this guaranties that first integer is successfully read and also after the integer <ENTER> is hit. If the character is anything but new line, then either the user did not enter an integer properly, or has some additional characters after the integer, which is not good. In this case clear the keyboard, print an error message and scan the integer again. See the flowchart below.
Grocery Store Inventory System: Assignment_3
4Loop while NL != \nScan Value and NLNL != \nStartgetInt()Set characterNL to xcreate integer ValuePrint error messageReturn ValueTrueTrueFalseFalseCall clrKyb()int getIntLimited(intlowerLimit, intupperLimit);This function uses getInt() to receive a valid integer and returns it. This function makes sure the integer entered is within the limits required (between lowerLimitand upperLimitinclusive). If the integer is not within the limits, it will print:> "Invalid value, TheLowerLimmit < value < TheUpperLimit: " < and try again. (Change the lower and upper limit with their values.)This function is fool-proof too; the function will not let the user pass until a valid integer is received within the lower and upper limit values. See below:
Grocery Store Inventory System: Assignment_4
5If Value is not within upper and lower limitsStart getIntLimited(upperLimit, lowerLimit)Create integer ValuePrint ErrorReturn ValueTrueTrueFalseFalseValue = getInt()Loop whileValue is not within upper and lower limitsdouble getDbl(void);Works exactly like getInt() but scans a double instead of an integer with the following error message: "Invalid number, please try again: "double getDblLimited(doublelowerLimit, doubleupperLimit);Works exactly like getIntLimited() but scans a double instead of an integer.
Grocery Store Inventory System: Assignment_5
6OUTPUT SAMPLE: (UNDERLINED, ITALICBOLDRED VALUES ARE USER ENTRIES)---=== Grocery Inventory System ===---listing header and footer with grand total:Row |SKU| Name | Price |Taxed| Qty | Min | Total |Atn----+---+--------------------+--------+-----+-----+-----+------------|-----------------------------------------------------------+---------------- Grand Total: | 1234.57listing header and footer without grand total:Row |SKU| Name | Price |Taxed| Qty | Min | Total |Atn----+---+--------------------+--------+-----+-----+-----+------------|-----------------------------------------------------------+----------------Press <ENTER> to continue... <ENTER>Enter an integer: abcInvalid integer, please try again: 10abcInvalid integer, please try again: 10You entered: 10Enter an integer between 10 and 20: 9Invalid value, 10 < value < 20: 21Invalid value, 10 < value < 20: 15Your entered 15Enter a floating point number: abcInvalid number, please try again: 2.3abcInvalid number, please try again: 2.3You entered: 2.30Enter a floating point number between 10.00 and 20.00: 9.99Invalid value, 10.000000< value < 20.000000: 20.1Invalid value, 10.000000< value < 20.000000: 15.05You entered: 15.05End of tester program for milestone one!MS1 SUBMISSION:To test and demonstrate execution of milestone 1, use the same data as the output example above.If not on matrix already, upload your ipc_ms1.cto your matrix account. Compile and run your code and make sure everything works properly.Before submission comment out your main function (the tester) in ipc_ms1.c. (Only the 9 functions you implemented are needed for the submission)Then run the following script from your account: (replace profname.proflastname with your professors’s Seneca userid)~profname.proflastname/submit ipc_ms1 <ENTER> and follow the instructions.
Grocery Store Inventory System: Assignment_6
7MILESTONE 2: THE APPLICATION USER INTERFACE (DUE SAT 5TH)Download or Clone milestone 2 from https://github.com/Seneca-144100/IPC_MS2 and copy the functions in milestone 1 into ipc_ms2.c.Now that the user interface tools are created and tested, we are going to build the main skeleton of our application. This application will be a menu driven program and will work as follows:1-When the program starts the title of the application is displayed.2-Then a menu is displayed. 3-The user selects one of the options on the Menu. 4-Depending on the selection, the corresponding action will take place.5-The Application will pause to attract the user’s attention6-If the option selected is not Exit program, then the program will go back to option 27-If the option selected is Exit program, the program ends. The above is essentially the pseudo code for any program that uses a menu driven user interface. To accomplish the above create the following three functions:int yes(void)Receives a single character from the user and then clears the keyboard (clrKyb()). If the character read is anything other than “Y”, “y”, “N” or “n”, it will print an error message as follows:>Only (Y)es or (N)o are acceptable: <and goes back to read a character until one of the above four characters is received. Then, it will return 1 if the entered character is either “y” or “Y”, otherwise it will return 0.
Grocery Store Inventory System: Assignment_7
8ReadCHIf CH is neither ofY,y,N or nStartyes()Have CH as a CharacterSet integer RET to 0Print error messageReturn RETTrueTrueFalseFalseRepeatWhile CH is neither ofY,y,Nor nSet RET to 1 if CH is either Yor yCall clrKyb()
Grocery Store Inventory System: Assignment_8

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Visual Studio Project | Assignment On C# Console Application
|3
|1002
|81