Question
You are contacted by a local store to build a desktop application in C# that will allow employees to look up the availability of a
You are contacted by a local store to build a desktop application in C# that will allow employees to look up the availability of a certain products and to restock. All products have a unique ID and a description. Products can be physical (ex. pen) or electronic (ex. e-book). For physical products, the store will have 0 or more items of a certain product available at a specific moment. Electronic products are unlimited.
The set of features that the software must support are the following:
- Search: An employee can search for a product in the store database. Employees will enter a sequence of characters (which can enter either be a (partial) code and/or keywords) and the search should be performed on all possible fields (i.e., the employee should not be asked whether she/he wants to search by code or by keywords, this must be handled implicitly). If the sequence of characters contains one or more spaces, it would need to be split into tokens and the employee should be asked whether this is an AND search (all tokens must be present in each product) or and OR search (at least one of the tokens must be present in each product). The result will be the list of products that match the search. For each product that matches the search all available information about the product and the current items associated with that product at the moment in the store must be displayed. If the user enters an empty sequence of characters, i.e., she/he simply hits enter or space(s), then the result should be all products in the store.
- Save search: If an employee selects this functionality, the last search that was performed will be saved to a file in a subdirectory of the project called “searches”. The file name should indicate the date and time that the search was performed in the following format: --
- -hms.txt. For example, if the search was performed at 8:34:30pm on February 4, 2021 the filename would be “2021-02-04-20h34m30s.txt”
The first line of the file should contain the sequences of characters that the employee used for the search and whether it was an AND or OR search if applicable. The rest of the file, i.e., starting from line 2, must contain the result of the search as it was shown to the employee. - -hms.txt. For example, if the search was performed at 8:34:30pm on February 4, 2021 the filename would be “2021-02-04-20h34m30s.txt”
- Restock: If an employee selects this functionality, all physical products with less than N items will be restocked, where N is provided by the employee. First, the list of products that match the search will be shown, i.e., all products where the number of items is less than N. Then, the employee will be asked whether she/he would like to restock for all of them: If the response is positive, then for each product that matches the search all available information about the product and the number of current items associated with that product at the moment in the store must be displayed and the employee would be asked how many additional items need to be purchased. After that, a confirmation must be shown that the purchase is successful, and the updated product information must be shown. If the response is negative, the user should be given the option to change N or to return to the main menu.
Using TDD, implement a prototype that would fit the needs of the client as described above. Note: You do not have to worry about a user interface for now. You can build a prototype in a console application (Choose “Console App (.NET Core)” or “Console App (.NET Core)” when you are creating the project).
Step by Step Solution
3.43 Rating (159 Votes )
There are 3 Steps involved in it
Step: 1
using System using SystemCollectionsGeneric using SystemLinq using SystemText namespace ProductList class Program static void Mainstring args Product ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started