SlideShare a Scribd company logo
1 of 8
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

More Related Content

Similar to ObjectivesUse inheritance to create base and child classes.docx

IT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COM
IT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COMIT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COM
IT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COMalbert0061
 
Program Specifications Develop an inventory management system for an e.docx
Program Specifications Develop an inventory management system for an e.docxProgram Specifications Develop an inventory management system for an e.docx
Program Specifications Develop an inventory management system for an e.docxVictormxrPiperc
 
1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docxhoney690131
 
Testing Software Solutions
Testing Software SolutionsTesting Software Solutions
Testing Software Solutionsgavhays
 
Medical Shop - 2.pptx
Medical Shop - 2.pptxMedical Shop - 2.pptx
Medical Shop - 2.pptxsaiproject
 
Product Base Currency Magento Extension Manual 1.0.0.1
Product Base Currency Magento Extension Manual 1.0.0.1Product Base Currency Magento Extension Manual 1.0.0.1
Product Base Currency Magento Extension Manual 1.0.0.1innoexts
 
c programming 109.docx
c programming 109.docxc programming 109.docx
c programming 109.docxwrite31
 
Program Specifications in c++ Develop an inventory management system f.docx
Program Specifications in c++ Develop an inventory management system f.docxProgram Specifications in c++ Develop an inventory management system f.docx
Program Specifications in c++ Develop an inventory management system f.docxsharold2
 
Program Specifications in c++ Develop an inventory management syste.docx
Program Specifications in c++    Develop an inventory management syste.docxProgram Specifications in c++    Develop an inventory management syste.docx
Program Specifications in c++ Develop an inventory management syste.docxsharold2
 
show code and all classes with full implementation for these Program S.pdf
show code and all classes with full implementation for these Program S.pdfshow code and all classes with full implementation for these Program S.pdf
show code and all classes with full implementation for these Program S.pdfAlanSmDDyerl
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosFlutter Agency
 
Programming Presentation.pptx
Programming Presentation.pptxProgramming Presentation.pptx
Programming Presentation.pptxAungMyintTun3
 
Manageing security
Manageing securityManageing security
Manageing securityI-Tèë Lëk
 
Automation frameworks
Automation frameworksAutomation frameworks
Automation frameworksVishwanath KC
 
Cyber Security wk 8 paperAssignment 2 Implementing Network a.docx
Cyber Security wk 8 paperAssignment 2 Implementing Network a.docxCyber Security wk 8 paperAssignment 2 Implementing Network a.docx
Cyber Security wk 8 paperAssignment 2 Implementing Network a.docxtheodorelove43763
 
Electronic waste system project report.pdf
Electronic waste system project report.pdfElectronic waste system project report.pdf
Electronic waste system project report.pdfIyedSoumri
 

Similar to ObjectivesUse inheritance to create base and child classes.docx (20)

IT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COM
IT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COMIT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COM
IT 145 FINAL PROJECT GUIDELINES / TUTORIALOUTLET DOT COM
 
Program Specifications Develop an inventory management system for an e.docx
Program Specifications Develop an inventory management system for an e.docxProgram Specifications Develop an inventory management system for an e.docx
Program Specifications Develop an inventory management system for an e.docx
 
1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx1 Goals. 1. To use a text file for output and later for in.docx
1 Goals. 1. To use a text file for output and later for in.docx
 
Testing Software Solutions
Testing Software SolutionsTesting Software Solutions
Testing Software Solutions
 
Medical Shop - 2.pptx
Medical Shop - 2.pptxMedical Shop - 2.pptx
Medical Shop - 2.pptx
 
Product Base Currency Magento Extension Manual 1.0.0.1
Product Base Currency Magento Extension Manual 1.0.0.1Product Base Currency Magento Extension Manual 1.0.0.1
Product Base Currency Magento Extension Manual 1.0.0.1
 
c programming 109.docx
c programming 109.docxc programming 109.docx
c programming 109.docx
 
Program Specifications in c++ Develop an inventory management system f.docx
Program Specifications in c++ Develop an inventory management system f.docxProgram Specifications in c++ Develop an inventory management system f.docx
Program Specifications in c++ Develop an inventory management system f.docx
 
Program Specifications in c++ Develop an inventory management syste.docx
Program Specifications in c++    Develop an inventory management syste.docxProgram Specifications in c++    Develop an inventory management syste.docx
Program Specifications in c++ Develop an inventory management syste.docx
 
ibuyer_Manual
ibuyer_Manualibuyer_Manual
ibuyer_Manual
 
show code and all classes with full implementation for these Program S.pdf
show code and all classes with full implementation for these Program S.pdfshow code and all classes with full implementation for these Program S.pdf
show code and all classes with full implementation for these Program S.pdf
 
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex ScenariosUnit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
 
Programming Presentation.pptx
Programming Presentation.pptxProgramming Presentation.pptx
Programming Presentation.pptx
 
Manageing security
Manageing securityManageing security
Manageing security
 
Sale Record System
Sale Record SystemSale Record System
Sale Record System
 
Automation frameworks
Automation frameworksAutomation frameworks
Automation frameworks
 
MSSQL Queries.pdf
MSSQL Queries.pdfMSSQL Queries.pdf
MSSQL Queries.pdf
 
Cyber Security wk 8 paperAssignment 2 Implementing Network a.docx
Cyber Security wk 8 paperAssignment 2 Implementing Network a.docxCyber Security wk 8 paperAssignment 2 Implementing Network a.docx
Cyber Security wk 8 paperAssignment 2 Implementing Network a.docx
 
Electronic waste system project report.pdf
Electronic waste system project report.pdfElectronic waste system project report.pdf
Electronic waste system project report.pdf
 
Sap enhanced functions
Sap enhanced functionsSap enhanced functions
Sap enhanced functions
 

More from mccormicknadine86

Option #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docxOption #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docxmccormicknadine86
 
Option 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docxOption 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docxmccormicknadine86
 
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docxOption Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docxmccormicknadine86
 
Option A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docxOption A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docxmccormicknadine86
 
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docxOption 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docxmccormicknadine86
 
OPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docxOPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docxmccormicknadine86
 
Option 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docxOption 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docxmccormicknadine86
 
Option A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docxOption A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docxmccormicknadine86
 
Option #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docxOption #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docxmccormicknadine86
 
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docxOption 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docxmccormicknadine86
 
Option 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docxOption 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docxmccormicknadine86
 
Option #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docxOption #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docxmccormicknadine86
 
Option A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docxOption A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docxmccormicknadine86
 
opic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docxopic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docxmccormicknadine86
 
Option 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docxOption 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docxmccormicknadine86
 
Option #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docxOption #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docxmccormicknadine86
 
Operationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docxOperationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docxmccormicknadine86
 
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docxOpen the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docxmccormicknadine86
 
onsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docxonsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docxmccormicknadine86
 
Operations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docxOperations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docxmccormicknadine86
 

More from mccormicknadine86 (20)

Option #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docxOption #2Researching a Leader Complete preliminary rese.docx
Option #2Researching a Leader Complete preliminary rese.docx
 
Option 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docxOption 1 ImperialismThe exploitation of  colonial resources.docx
Option 1 ImperialismThe exploitation of  colonial resources.docx
 
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docxOption Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
Option Wireless LTD v. OpenPeak, Inc.Be sure to save an elec.docx
 
Option A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docxOption A Land SharkWhen is a shark just a shark Consider the.docx
Option A Land SharkWhen is a shark just a shark Consider the.docx
 
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docxOption 3 Discuss your thoughts on drugs and deviance. Do you think .docx
Option 3 Discuss your thoughts on drugs and deviance. Do you think .docx
 
OPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docxOPTION 2 Can we make the changes we need to make After the pandemi.docx
OPTION 2 Can we make the changes we need to make After the pandemi.docx
 
Option 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docxOption 1 You will create a PowerPoint (or equivalent) of your p.docx
Option 1 You will create a PowerPoint (or equivalent) of your p.docx
 
Option A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docxOption A Description of Dance StylesSelect two styles of danc.docx
Option A Description of Dance StylesSelect two styles of danc.docx
 
Option #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docxOption #2Provide several slides that explain the key section.docx
Option #2Provide several slides that explain the key section.docx
 
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docxOption 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
Option 2 Slavery vs. Indentured ServitudeExplain how and wh.docx
 
Option 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docxOption 2 ArtSelect any 2 of works of art about the Holocaus.docx
Option 2 ArtSelect any 2 of works of art about the Holocaus.docx
 
Option #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docxOption #1 Stanford University Prison Experiment Causality, C.docx
Option #1 Stanford University Prison Experiment Causality, C.docx
 
Option A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docxOption A  Gender CrimesCriminal acts occur against individu.docx
Option A  Gender CrimesCriminal acts occur against individu.docx
 
opic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docxopic 4 Discussion Question 1 May students express religious bel.docx
opic 4 Discussion Question 1 May students express religious bel.docx
 
Option 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docxOption 1Choose a philosopher who interests you. Research that p.docx
Option 1Choose a philosopher who interests you. Research that p.docx
 
Option #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docxOption #1The Stanford University Prison Experiment Structu.docx
Option #1The Stanford University Prison Experiment Structu.docx
 
Operationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docxOperationaland Organizational SecurityChapter 3Princ.docx
Operationaland Organizational SecurityChapter 3Princ.docx
 
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docxOpen the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
Open the file (Undergrad Reqt_Individual In-Depth Case Study) for in.docx
 
onsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docxonsider whether you think means-tested programs, such as the Tem.docx
onsider whether you think means-tested programs, such as the Tem.docx
 
Operations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docxOperations security - PPT should cover below questions (chapter 1 to.docx
Operations security - PPT should cover below questions (chapter 1 to.docx
 

Recently uploaded

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Recently uploaded (20)

Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

ObjectivesUse inheritance to create base and child classes.docx

  • 1. 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
  • 2. 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
  • 3. 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:
  • 4. 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.
  • 5. 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
  • 6. 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)
  • 7. 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)
  • 8. 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