[Solved] EE312 Project 4- CRM system for a hypothetical small company

$25

File Name: EE312_Project_4-_CRM_system_for_a_hypothetical_small_company.zip
File Size: 565.2 KB

SKU: [Solved] EE312 Project 4- CRM system for a hypothetical small company Category: Tag:
5/5 - (1 vote)

: In this project you will write an inventory and customer relationship management (CRM) system for a hypothetical small company, Ellies Baby Emporium. Your program will use the String abstract data type from class.

GRADING: you will be graded on producing the output precisely as documented. That includes all punctuation, capitalization, spacing, spelling errors, etc. You will also be graded on your programs avoidance of memory leaks.

Summary of the task: When main.cpp is run, it reads input commands from a text file with a specified format, i.e., a series of one-word commands and arguments for each command. The required read function is provided to you. As each command is read from the input file, it is parsed (code provided), and then each command is executed (your code). The command processing functions (and helper functions) that you write must interact with a database (which is represented as an array of structs) that is provided to you, but must be modified and read by you in your code.

Input: Your system will read input from a file. The file contains a sequence of commands. Each command begins with one of four keywords. The remainder of the command depends upon the keyword.

  • Inventory <type> # This command is used to record a new shipment from the factory into the stores inventory. To read this command you must read from the file the type of item received (Bottles, Diapers, or Rattles) and the number of items in this shipment. You should then increase the stores inventory by that amount. For example: Inventory Bottles 50 means that 50 bottles should be added to the stores inventory.
  • Purchase <name> <type> # This command is used to record a purchase by a customer. Each customer is known by their first name (its a very friendly company), so <name> will be a one-word string for the customers name. The

<type> is once again Bottles, Diapers, or Rattles and is used to indicate what type of item this customer purchased. Finally, the last part of the command is the number of items purchased. For example, Purchase Frank Diapers 100 means that the customer

Frank has purchased 100 Diapers.

  • Summarize This command requests that a summary be printed of the stores activity.
  • Quit This command terminates the input.

To get you started, main.cpp includes source code for reading the keyword at the start of each command and understanding the keyword. What main.cpp will do is invoke one of three functions depending upon what the keyword is.

  • processInventory() This function should read the item type and quantity from the input file and update the stores inventory of the indicated item type.
  • processPurchase() This function should read the customers name, the item type and the quantity. The function should look up the customer in the customer database

(creating a new customer record if this is a 1st-time customer) and increment the number of items purchased by this customer in their customer record. For example, if the customer record indicates that Frank had previously purchased 10 diapers and the current command indicates that Frank is purchasing 20 diapers, then the customer record should be set to indicate that 30 diapers have been purchased by Frank. Note that each customer should have their own customer record (so that Ellie can keep track of who her best customers are and offer incentives like coupons and things).

  • processSummarize() This command should print out a summary. The summary should first display the number of Bottles, Rattles, and Diapers remaining in inventory at the time of the Summarize Next, the summary should display how many different customers have come to the store for purchases. Finally, the summary should report which customer purchased the most diapers (and how many diapers), who purchased the most bottles (and how many) and who purchased the most rattles (and how many). If a certain item has not been purchased by anybody, then the summary should indicate that.

You are provided with three input files. At the end of each file (after the Quit command) is a transcript of what the output should be from the Summary command. Please format your output exactly as shown in the file.

Error Handling: Note of course, that it is not possible to sell someone 50 bottles if there are only 20 in the inventory. If an error occurs when a purchase is attempted and the amount exceeds the amount currently in inventory, your processPurchase routine should print an error message, Sorry <name>, we only have %d <type> (see the test files for the exact format the error message should take.) In this case, you should not update either the inventory or the customer record (and you should not add any new customers to the database unless they actually buy something).

Your Mission: Edit the file Project4.cpp to complete this project. To read from the input file, you may use two functions readNum and readString. Both of these functions are inside main.cpp and you should not change these functions in any way. You should only call readNum when the next parcel of input in the input file is a number (you can always know whats coming because the commands are formatted in a specific order). When the next parcel in the input file is a string (like the customers name, or the type of item purchased), use readString. Be sure to use StringDestroy appropriately to avoid memory leaks.

The Customer struct is defined in Invent.h. You should use this struct to keep track of all the customers. For this project well assume that there will be a maximum of 1000 customers, so an array of 1000 Customer structs will be adequate, and most of the elements of the array will never actually be used. Each time you read a customers name, you should search through this array to find a matching customer. Obviously, if there have only been three customers so far, you should only search the first three entries in the array to find a match. Use the comparison function from the String abstract data type (StringIsEqualTo) to check to see if two Strings are the same. Note: you are required to use the Customer struct as defined in Invent.h AND you are required to use the String ADT example provided in String.h/String.cpp. PLEASE take a

look at String.h! For this project you will need to call at least StringDestroy and

StringIsEqualTo. The code in main.cpp illustrates how these functions can be used.

Your program must produce exactly the same output as specified in the test files, including the same punctuation, capitalization, spacing and typographical errors (if any) present in those files. In addition, your program should produce the correct corresponding output for any other test file that we might create (with the equivalent formatting, punctuation, capitalization, typos, etc.).

Testing: Weve supplied three test files. Please note that all three test files use Summarize as the last command in the file. Please do not assume that Summarize has to be the last command in a file, or that Summarize can appear only once. Any command can appear any number of times in any order. You might want to write your own test files (as always). You can edit the files using any text editor.

The test files provided with this project are VERY weak. They are intended merely to help you understand what your program is supposed to do (generally speaking). They are not intended to help you detect errors in your program. Feel free to share test cases and their outputs on Piazza/Canvas with the whole class. If the only testing you do is with the tests we provide to you well, good luck, youll need it.

Provided File Description
CRM.pdf This document containing the description.
Invent.h Inventory data structures interface.
MyString.cpp MyString.h A String ADT with added functionality.
Project4.cpp The file that you will submit to the graders.
main.cpp Contains main, and starter code to read the input files, parse their contents, and call the functions that you write in Project3.cpp.
test1.txt test2.txt test3.txt Sample input files.
Makefile Used for testing on kamek

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] EE312 Project 4- CRM system for a hypothetical small company
$25