Question

InventoryManagement


Problem:

A small electronics company has hired you to write an application to manage their inventory. The company requested a role-based access control (RBAC) to increase the security around using the new application. The company also requested that the application menu must be flexible enough to allow adding new menu items to the menu with minimal changes. This includes re-ordering the menu items and making changes to the description of a menu item without having to change the code.

Security:

The company has suggested to start the application by prompting the user for a username and password to authenticate the user. There are two types of users at this company, managers and employees. If managers log on to the application, they will see all options on the menu list. If employees log on to the application, they will see a limited set of options on the menu list. User information is stored in Users.dat file, which may or may not exist at the start of the program. A super user “admin” with password “admin” has already been hardcoded in the program to allow for the initial setup and the creation of other users. The Users.dat file contains the FirstName, LastName, Username (case insensitive), HashedPassword and a flag to indicate whether a user is a manager or not. The file is comma separated and it is formatted as follows:

Joe, Last, jlast, 58c536ed8facc2c2a293a18a48e3e120, true
Sam, sone, samsone, 2c2a293a18a48e3e12058c536ed8facc, false
Jane, Best, jbest, 293a18a48e3e12052058c536ed8facc2c, false

Note: Ensure that the 'AddUser' function does not add duplicate values, and the 'ChangePassword' function does not change password if username/password is entered incorrectly. If adding a new user or changing the password is successful, return true, or else return false.

Application Menu:

The menu of the application is dynamically loaded and displayed to the user only after the user successfully logs on. The menu items will be loaded from file “MenuList.dat”, which may or may not exist at the start of the application. If the file doesn’t exist, the application should show at least an Exit menu item as default. The file will contain all menu items details, including the name of the command that will be executed when the menu item is selected. If a menu item is marked as restricted (Boolean flag), only managers can see that item. The file contains the following comma separated fields, Description, a Boolean flag to indicate if the option is restricted to managers only, and the name of the menu command that will be executed when the option is chosen. The order and option number of a menu item may change depending on how they are listed in the file. The Exit option will always be listed last and it will not be in the file.

Below is a sample of how the MenuList.dat file looks like:

Add User, true, AddUserCommand
Delete User, true, DeleteUserCommand
Change Password, false, ChangePasswordCommand
Add New Product, true, AddProductCommand

Note: The command name of each menu item must match the name of the class that you will create in the code (See AddProductCommand class in the code for example).

Inventory:

The inventory consists of multiple products of type Product stored in class ProductCatalog. The ProductCatalog is responsible of all inventory operations that add, remove, find and update a product. When printing a product information, the product retail price should be calculated and displayed as well. Retail price = (cost + (margin * cost/100)). A list of functions has been added to this class in the provided code template. You must implement all listed functions. The inventory products will be saved in file Inventory.dat, which may or may not exist when the program first starts. The file will contain the product unique id (int), product name (string), cost (double), quantity (int) and margin (int, integer that represents margin percentage).

The Inventory.dat file is comma separated and formatted as follows:

3424, Smart Watch, 20.45, 23, 80
65454, Flat Screen TV, 465.98, 15, 35
435, Computer Monitor, 123.54, 84, 43

Program Flow:

  • Program starts in main() method

  • Prompt user for username and password

  • Authenticate user and maintain the logged-on user object

  • Load inventory

  • Load and create menu list

  • Display menu list and prompt the user for option

  • Execute selected option

  • Keep displaying the menu until the user chooses to exit

Output Format:

Enter username: some username
Enter password: some password //Repeat prompts until user is authenticated OR show error and
option to exit.
Invalid username or password!
Press enter to continue or “Exit” to exit:
Enter username: some username
Enter password: some password
Welcome Firstname LastName!
Inventory Management System Menu //This is the header of the MenuList

// The order and option number of a menu item may change depending on how they are listed in the MenuList.dat file. The Exit option will always be listed last and it will not be in the MenuList.dat file.

1- Add user
2- Remove user
3- Change password
4- Add new product
5- Update product information
6- Delete product
7- Display product information
8- Display inventory
9- Exit
Enter your selection: 7
Enter product name: sMaRt wAtCh

Id Name Cost Quantity Retail
----------------------------------------------------
3424 Smart Watch $20.45 23 $36.81

//Repeat the menu after each command is executed

Unit Testing:

A unit test method is required to test each of the methods listed below. These methods will be used by the unit testing framework to test the accuracy of your code.

  • InventoryManagementSecurity.AuthenticateUser

  • InventoryManagementSecurity.AddNewUser

  • InventoryManagementSecurity.RemoveUser

  • InventoryManagementSecurity.ChangePassword

  • MenuList.AddMenuItem()

  • ProductCatalog.AddUpdateProduct(Product product)

  • ProductCatalog.RemoveProduct(int productId)

  • ProductCatalog.FindProduct(int productId)

  • ProductCatalog.PrintProductInformation(int productId)

  • ProductCatalog.PrintInventoryList()

Grading:

  • Coding standards, style and comments (10 Points)

  • Unit testing methods x 10, (2 points for each of the methods mentioned above - 20 Points)

  • The rest of the grade will be broken down as follows:

  • InventoryManagementSecurity.AuthenticateUser (5 Points)

  • InventoryManagementSecurity.AddNewUser (5 Points)

  • InventoryManagementSecurity.RemoveUser (5 Points)

  • InventoryManagementSecurity.ChangePassword (5 Points)

  • MenuList.AddMenuItem() (20 Points) //This includes implementing all commands for the menu list

  • ProductCatalog.AddUpdateProduct(Product product) (10 Points)

  • ProductCatalog.RemoveProduct(int productId) (5 Points)

  • ProductCatalog.FindProduct(int productId) (5 Points)

  • ProductCatalog.PrintProductInformation(int productId) (5 Points)

  • ProductCatalog.PrintInventoryList() (5 Points)

CodeFormat.docx


4 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

14 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
InventoryManagement
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Java Inventory Management Code Question

    Inventory ManagementObjectives:Use inheritance to create base and child classesUtilize multiple classes in the same programPerform standard input validationImplement a solution that uses polymorphismProblem:A small electronics company has hired you to write an application to manage their inventory. The company requested a role-based access control (RBAC) to increase the security around using the new application. The company also requested that the application menu must be flexible enough to allow adding new menu items to the menu with minimal changes. This includes...

  • Hashmap concept

    HashMap:  We can use a HashMap to store key value pairs.  Reminder that only reference types can be used as the key or value.  It you want to use a number as the key then an Integer data type could be used but not an int primitive data type.Create a class called Login which contains a HashMap as a private attribute.  It should also have an instance method called loadCredentials which accepts the two arrays.  It will load the HashMap...

  • You have to write a java solution for a store. Part 1 The solution needs to...

    You have to write a java solution for a store. Part 1 The solution needs to have at least following features: ◦ Item: Name, ID (incremental ID by 1 for each product), Price. ◦ Store Basket: ID (incremental ID by 1 for each basket), Net Amount, Total Amount, VAT, List of items, Date and Time of purchase, Address of the store, name of cashier. ◦ Cashier: Name, Surname, Username and Password (insert from code five fixed cashiers). ◦ Manager: Name,...

  • Lab 4: Databased Admin Tool Continued Python Objective: In the previous lab, you developed an admin tool for username an...

    Lab 4: Databased Admin Tool Continued Python Objective: In the previous lab, you developed an admin tool for username and password management. You accomplished the tasks with Dictionary or List. Here, use class to design your own data structure to accomplish a similar task. The UD.txt datafile: FIRST NAME, LAST NAME,USERNAME,PASSWORD Sam, DDal,sdd233,Pad231 Dave, Dcon,dcf987, BHYW4fw Dell, Grant,dgr803,Sb83d2d Mike, Kress,mkr212,UNNHS322 Lisa,Kate,lki065,dgw6234 Paul,Edward,ped332,9891ds Youyou,Tranten,ytr876,dsid21kk Nomi,Mhanken,nmh223,3282jd3d2 Write a program that imports the database from UD.txt, your program can search for users’ password....

  • Create a python script to manage a user list that can be modified and saved to...

    Create a python script to manage a user list that can be modified and saved to a text file. Input text file consisting of pairs of usernames and passwords, separated by a colon (:) without any spaces User choice: (‘n’-new user account, ‘e’-edit existing user account, ‘d’- delete existing user account, ‘l’- list user accounts, ‘q’-quit) List of user accounts, error messages when appropriate Output text file consisting of pairs of username and passwords, separated by a colon (:) without...

  • I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need...

    I am a college student taking an INTRODUCTORY Windows 10 Operating System SCRIPTING course and need some help with the batch file I am creating for a homework assisgnment.   I created the menu below and need some help with option A Please choose a task from the list below A) Add a new user account I need to use SET /P to prompt for a login name and if the user already exists display a message and return to the...

  • ATM MACHINE

    Kindly help me In this assignment you will create a RMI based system that allows a user to do the following: 1) Create a bank account by supplying a user id and password. 2) Login using their id and password. 3) Quit the program. Main Manu of ATM service window *Separate remote methods will be created for all of these functionalities. ->To create account see output below Hi! Welcome to  ATM Machine! Please select an option from the menu below: l -> Loginc -> Create New Account q -> Quit > c...

  • Program is in C++, program is called airplane reservation. It is suppose to display a screen...

    Program is in C++, program is called airplane reservation. It is suppose to display a screen of seating chart in the format 1 A B C D E F through 10. I had a hard time giving the seats a letter value. It displays a correct screen but when I reserve a new seat the string seats[][] doesn't update to having a X for that seat. Also there is a file for the struct called systemUser.txt it has 4 users...

  • Banking System (Java Programming) 1 bank (Bank) has 5 accounts holder (Account) also designing te...

    Banking System (Java Programming) 1 bank (Bank) has 5 accounts holder (Account) also designing textbased menu (switch case): Main Menu: 1. Admin Login 2. User Login 3. Exit Admin Menu: 1. Add an Account 2. Remove an Account 3. Print total balance 4. Print total balance per city 5. Go back to main menu User Login 1. Withdraw //also redo last withdraw 2. Deposit //also redo last deposit 3. print account 4. Go back to main menu Designing class Account...

  • Below is the code for the class shoppingList, I need to enhance it to accomplish the...

    Below is the code for the class shoppingList, I need to enhance it to accomplish the challenge level as stated in the description above. public class ShoppingList {   private java.util.Scanner scan; private String[] list; private int counter; public ShoppingList() { scan = new java.util.Scanner(System.in); list = new String[10]; counter = 0; } public boolean checkDuplicate(String item) { for(int i = 0; i < counter; i++) { if (list[i].equals(item)) return true; } return false; } public void printList() { System.out.println("Your shopping...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT