Java program

7.2 Inventory Management

Submission Details:

  • Part 1 to be submitted on eLearning. See the Notes section below for details. 
  • Zip the contents of the src directory into a single zipped file for Part 1 submission.
  • Make sure the zipped file has a .zip extension (not .tar, .rar, .7z, etc.)
  • Part 2 to be submitted on zyBooks. Make sure you remove the package name from your files before submitting.

Objectives:

  • Use inheritance to create base and child classes
  • Utilize multiple classes in the same program
  • Perform standard input validation
  • Implement a solution that uses polymorphism

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)

Notes:

  • The “InventoryManagement” Maven solution zip file has been provided to you in eLearning.
  • All *.dat files are assumed to be local to the current executable.
  • Do not change the methods stubs or constructors in the template. If in doubt, please ask.
  • Your program is expected to have basic input validation.
  • You may use ArrayList in this project
  • Part 1 deliverables: Unit Test methods + AuthenticateUser() function (no add or remove user is required in part 1). See eLearning for due date.
  • Part 2 deliverables: Functioning program including the Unit Test methods

Physical Security

 Complete a Physical Security Assessment (internal and external) of your  place of work or living area.  If you use your work area make sure you  inform the Security Manager to get permission as to what you are doing.  If you live in a gated community inform the security guard of your  activities. Refer to your text on the importance of Lighting and Access  Control and be sure to cover the salient issues discussed in the text.   

This one IP is worth 200 points. Parts 1 and 2 together are worth 100 points. Part 3, which is “summative” is worth 100 points.

 Note: This one IP is worth 200 points. Parts 1 and 2 together are worth 100 points. Part 3, which is “summative” is worth 100 points. Part 1: In a two-phase, total-order multicast system, messages are sent in the following sequence from node S to G1 and G2. G1 and G2 are the members of the group. 1. S sends m1 to G1 2. S sends m1 to G2 3. S sends m2 to G2 4. S sends m2 to G1 Use the basic implementation of the Lamport clock. The clock s at each node start at: S: 4, G1: 6, G2: 1 Show the exchange of messages and their acknowledgments in a clock diagram using the basic implementation of Lamport’s clock. In which order and at what times are m1 and m2 delivered? Part 2. Draw a state diagram of Maekawa’s voting algorithm on the slide “Maekawa’s algorithm” in the “Distributed mutual exclusion” slide set. Note that the state diagram is from the point of view of any one of the nodes, called “this” node below. The state diagram cannot show the states of other nodes. i) Start with the basic case where “this” node wants the lock, gets it, and then releases it, and no other node wants the lock at the same time. In this case, “this” node goes through all the states in this order: Released and not voted Wanted and not voted Wanted and voted Held and voted Released and voted (Back to) Released and not voted Events are: acquire for when “this” node wants the lock release for when “this” node gives up the lock. 8/7/20 3:01 PM 15 request_received, reply_received, and release_received when a message from any node arrives at “this” node. The state diagram is similar the one of Ricart and Agrawala’s state machine (in the Distributed Mutual Exclusion PowerPoint deck) but has more states. *** If you do part i) more or less correctly, you will earn most of the points. *** ii) The complete solution includes the situations where “this” node votes on requests from other nodes. The states are the same as above, but there are additional transitions and actions. Use the “Maekawa scenario” slide in the Distributed Mutual Exclusion slide set, or Fig. D-10 in the Study Guide. Warning: There is an incorrect solution for this problem on the Web. It has extra, incorrect states. Part 3 (100 points): Summarize the course in your own words in an essay of 5-6 pages or so. Feel free to reuse any relevant DB posts as well as Unit 3 IP, but please correct any errors found. Edit it all into one paper that reads nicely from top to bottom and is styled according to APA. Include at a minimum: • How threads and safe objects interact. This can be in general or based on Ada or Java. • Entity-life modeling: the idea of finding event-sequence models of the domain and map them onto thread architectures in the software. Deadlock prevention. • The use of logical clocks for communication and/or for distributed mutual exclusion.  

Risk Assessment

I need help with creating a risk assessment based on Equifax breach that occured in 2017. I have attached the milestone three rubric, aswell as milestone one and milestone two that was completed by me. 

Pract connection

How Cloud services are helpful in utility sector. 

The document should be of min 400 to 500 words with references(Optional).

Discussion 8 – info tech strat plan

In the last week of class, we are going to complete a reflection activity.

This discussion topic is to be reflective and will be using your own words (500 words)and not a compilation of direct citations from other papers or sources. You can use citations in your posts, but this discussion exercise should be about what you have learned through your viewpoint and not a re-hash of any particular article, topic, or the book.

Items to include in the initial thread: 

  • “Interesting Assignments” – What were some of the more interesting assignments to you? 
  • “Interesting Readings” – What reading or readings did you find the most interesting and why? “Interesting Readings”
  • “Perspective” – How has this course changed your perspective? 
  • “Course Feedback” – What topics or activities would you add to the course, or should we focus on some areas more than others?

CC W 9 D

 Select from the following list four (4) topics and discuss. Use only 50-words max per topic to discuss and present your answer.  The discussion questions this week are from Chapter 10  (Jamsa, 2013).Chapter 10 topics:

  • Define and describe business continuity.
  • Define and describe disaster recovery.
  • Discuss pros and cons of cloud-based backup operations.
  • Discuss threats to an IT data center infrastructure and provide cloud-based solutions to mitigate the risks.
  • Create a DRP for a company with which you are familiar.

NOTE: You are required to use at least two-peer reviewed sources (besides your textbook) to answer the above questions.