SlideShare a Scribd company logo
1 of 5
Download to read offline
Develop an inventory management system for an electronics store. The inventory system should
have the following functionalities .BuildInventory: reada text file containing electronics products
information and store them in an array of pointers .Shownventory display all inventory items
.ShowDefectInventory: display inventory items that are defective Terminate: to save cument
inventory to a text file This lab assignment illustrates the following concepts: -Text file readings
and writings .Arrays of pointers and dynamic memory allocations with new and delete
Inheritance .C++ type casting: static cast Class Design You need at least three classes class
Inventory System: (minimum implementation specified below). This class stores Inyentoryltem
objects (which are in fact Inventory item base class pointers to derived Product objects and
member functions to manipulate those Product objects as shown below. .Private data members
Store Name Store ID ltem List (array of pointers to Inventory Item objects, max of 512) ltem
Count (tracking how many items are currently stored in the array) .Constructors (initialize all
pointers in the array to NULL in addition to what's described below .Default constructor: set
data members to 0 (for integers), 0.0 (for float/double), or NULL (for pointers) as appropriate.
Also invoke this function to initialize a seed for the random generator srand (time (NULL), (to
be used later by Product class to genearte random values for Product ID. See Code Helper
section at the end of the lab specs.) .Non-default constructor: taking a string for store name, an
integer for store ID. Call srand as shown above Destructor: de-allocate dynamic memory in the
amay off pointers (up to Item Count elements) .Public member functions: BuildInventory: read a
text file containing Product records (one Product per line), dynamically allocate Product objects
and store the objects in the array ItemList (an array of Inventoryltem pointers). It should also
update Item Count as needed Shownventory: display all Products in the inventory. Output must
be properly formatted and aligned (usingfield with and floating data with 2 digits after decimal
point). Note that if you invoke the Display function using the pointers from the array only Invent
tem (base objec) information will be displayed. Extra work is needed to properly display
Products (derived objects) information ntory: display only defective Products Terminate: iterate
thru the array of pointers to write Product objects in the array to a text file in the same format as
they were read in. You may use a different file name for wniting .mutator cessors for store name,
store id, and item count
Solution
/*
import com.incors.plaf.*;
import com.incors.plaf.kunststoff.*;
import com.incors.plaf.kunststoff.themes.*;
*/
public class MainForm extends JFrame implements WindowListener{
/************************ Variable declaration start **********************/
//The form container variable
JPanel Panel1;
JDesktopPane Desk1 = new JDesktopPane();
JLabel StatusLabel = new JLabel("Copyright © 2004 by Philip V. Naparan. All Rights
Reserved. Visit http://www.naparansoft.cjb.net.",JLabel.CENTER);
JLabel BusinessTitleLabel = new JLabel();
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
String StrBusinesTitle;
String DBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
String DBSource = "jdbc:odbc:NaparansoftInventory";
String DBUserName = "Admin";
String DBPassword = "philip121";
Connection CN;
//--Start variable the contains forms
FrmCustomer FormCustomer;
FrmSupplier FormSupplier;
FrmSalesRep FormSalesRep;
FrmWarehouse FormWarehouse;
FrmProduct FormProduct;
FrmInvoice FormInvoice;
FrmSplash FormSplash = new FrmSplash();
//--End variable the contains forms
Thread ThFormSplash = new Thread(FormSplash);
//End the form container variable
/********************** End variable declaration start ********************/
/************************ MainForm constructor start **********************/
public MainForm(){
//Set the main form title
super("Naparansoft Inventory System version 1.1");
//End set the main form title
loadSplashScreen();
//We will dispose now the FormSplash because it is now useless
FormSplash.dispose();
//StatusLabel.setBorder(BorderFactory.createTitledBorder(""));
StatusLabel.setFont(new Font("Dialog", Font.PLAIN, 12));
StrBusinesTitle = "Your Business Name";
BusinessTitleLabel.setText(StrBusinesTitle);
BusinessTitleLabel.setHorizontalAlignment(JLabel.LEFT);
BusinessTitleLabel.setForeground(new Color(166,0,0));
//Set the main form properties
addWindowListener(this);
Desk1.setBackground(Color.gray);
Desk1.setBorder(BorderFactory.createEmptyBorder());
//Most fastest drag mode
Desk1.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
Panel1 = new JPanel(new BorderLayout());
Panel1.setBackground(Color.gray);
Panel1.setBorder(BorderFactory.createLoweredBevelBorder());
Panel1.add(new JScrollPane(Desk1),BorderLayout.CENTER);
getContentPane().add(CreateJToolBar(),BorderLayout.PAGE_START);
getContentPane().add(Panel1,BorderLayout.CENTER);
getContentPane().add(StatusLabel,BorderLayout.PAGE_END);
setJMenuBar(CreateJMenuBar());
setExtendedState(this.MAXIMIZED_BOTH);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
setIconImage(new ImageIcon("images/appicon.png").getImage());
setLocation(0,0);
setSize(screen);
setResizable(true);
setVisible(true);
show();
try{
Class.forName(DBDriver);
CN = DriverManager.getConnection(DBSource,DBUserName ,DBPassword);
}catch(ClassNotFoundException e) {
System.err.println("Failed to load driver");
e.printStackTrace();
System.exit(1);
}
catch(SQLException e){
System.err.println("Unable to connect");
e.printStackTrace();
System.exit(1);
}
//End set the main form properties
}
/********************** End MainForm constructor start ********************/
/*********************** Custom class creation start **********************/
//Create menu bar
protected JMenuBar CreateJMenuBar(){
JMenuBar NewJMenuBar = new JMenuBar();
//Setup file menu
JMenu MnuFile = new JMenu("File");
MnuFile.setFont(new Font("Dialog", Font.PLAIN, 12));
MnuFile.setMnemonic('F');
MnuFile.setBackground(new Color(255,255,255));
NewJMenuBar.add(MnuFile);
//End setup file menu
//Set file sub menu
JMenuItem ItmLockApp = new JMenuItem("lock Application");
ItmLockApp.setFont(new Font("Dialog", Font.PLAIN, 12));
ItmLockApp.setMnemonic('L');
ItmLockApp.setIcon(new ImageIcon("images/lockapplication.png"));
ItmLockApp.setAccelerator(
KeyStroke.getKeyStroke(
KeyEvent.VK_L,ActionEvent.CTRL_MASK
)
);
ItmLockApp.setActionCommand("lockapp");
ItmLockApp.addActionListener(JMenuActionListener);
ItmLockApp.setBackground(new Color(255,255,255));
JMenuItem ItmLoggOff = new JMenuItem("Logg Off");
ItmLoggOff.setFont(new Font("Dialog", Font.PLAIN, 12));
ItmLoggOff.setMnemonic('O');
ItmLoggOff.setIcon(new ImageIcon("images/loggoff.png"));
ItmLoggOff.setAccelerator(
KeyStroke.getKeyStroke(
KeyEvent.VK_O,ActionEvent.CTRL_MASK
)
);
ItmLoggOff.setActionCommand("loggoff");
ItmLoggOff.addActionListener(JMenuActionListener);
ItmLoggOff.setBackground(new Color(255,255,255));
JMenuItem ItmExit = new JMenuItem("Exit");
ItmExit.setFont(new Font("Dialog", Font.PLAIN, 12));
ItmExit.setMnemonic('E');
ItmExit.setIcon(new ImageIcon("images/exit.png"));
ItmExit.setAccelerator(
KeyStroke.getKeyStroke(
KeyEvent.VK_E,ActionEvent.CTRL_MASK
)
);
ItmExit.setActionCommand("exit");
ItmExit.addActionListener(JMenuActionListener);
ItmExit.setBackground(new Color(255,255,255));
MnuFile.add(ItmLockApp);
MnuFile.addSeparator();
MnuFile.add(ItmLoggOff);
MnuFile.add(ItmExit);
//End set file sub menu
//Setup records menu
JMenu MnuRec = new JMenu("Records");
MnuRec.setFont(new Font("Dialog", Font.PLAIN, 12));
MnuRec.setMnemonic('R');

More Related Content

Similar to Develop an inventory management system for an electronics store. The .pdf

ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationRandy Connolly
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5Mahmoud Ouf
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile appsIvano Malavolta
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfoliomwillmer
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4openerpwiki
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_manytutorialsruby
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_manytutorialsruby
 
Vtlib 1.1
Vtlib 1.1Vtlib 1.1
Vtlib 1.1Arun n
 
Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsSalesforce Developers
 
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...Cathrine Wilhelmsen
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfoliojlshare
 
C++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment InstructionsC++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment InstructionsTawnaDelatorrejs
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Codeerikmsp
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web appsIvano Malavolta
 
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfalokindustries1
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial EnAnkur Dongre
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial EnAnkur Dongre
 

Similar to Develop an inventory management system for an electronics store. The .pdf (20)

ASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And RepresentationASP.NET 08 - Data Binding And Representation
ASP.NET 08 - Data Binding And Representation
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4Open erp technical_memento_v0.6.3_a4
Open erp technical_memento_v0.6.3_a4
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_many
 
has_many_and_belongs_to_many
has_many_and_belongs_to_manyhas_many_and_belongs_to_many
has_many_and_belongs_to_many
 
Vtlib 1.1
Vtlib 1.1Vtlib 1.1
Vtlib 1.1
 
Using the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service ClientsUsing the Tooling API to Generate Apex SOAP Web Service Clients
Using the Tooling API to Generate Apex SOAP Web Service Clients
 
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
S.M.A.R.T. Biml - Standardize, Model, Automate, Reuse and Transform (SQLSatur...
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
 
Readme
ReadmeReadme
Readme
 
C++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment InstructionsC++ Programming Class Creation Program Assignment Instructions
C++ Programming Class Creation Program Assignment Instructions
 
Working Effectively With Legacy Perl Code
Working Effectively With Legacy Perl CodeWorking Effectively With Legacy Perl Code
Working Effectively With Legacy Perl Code
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web apps
 
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdfScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
ScenarioXYZ Corp. is a parent corporation with 2 handbag stores l.pdf
 
Salesforce
SalesforceSalesforce
Salesforce
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 

More from flashfashioncasualwe

How does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdfHow does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdfflashfashioncasualwe
 
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfHello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfflashfashioncasualwe
 
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdfFocus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdfflashfashioncasualwe
 
Decision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdfDecision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdfflashfashioncasualwe
 
Explain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdfExplain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdfflashfashioncasualwe
 
During a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdfDuring a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdfflashfashioncasualwe
 
Explain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdfExplain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdfflashfashioncasualwe
 
Describe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdfDescribe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdfflashfashioncasualwe
 
Explain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdfExplain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdfflashfashioncasualwe
 
Describe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdfDescribe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdfflashfashioncasualwe
 
All answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdfAll answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdfflashfashioncasualwe
 
C programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfC programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfflashfashioncasualwe
 
Add to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdfAdd to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdfflashfashioncasualwe
 
Write an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdfWrite an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdfflashfashioncasualwe
 
which of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdfwhich of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdfflashfashioncasualwe
 
2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdf2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdfflashfashioncasualwe
 
10. Benefits and costs of International Trade Search for a newspap.pdf
10. Benefits and costs of International Trade  Search for a newspap.pdf10. Benefits and costs of International Trade  Search for a newspap.pdf
10. Benefits and costs of International Trade Search for a newspap.pdfflashfashioncasualwe
 
Why does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdfWhy does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdfflashfashioncasualwe
 
Use the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdfUse the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdfflashfashioncasualwe
 
To vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdf
To vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdfTo vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdf
To vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdfflashfashioncasualwe
 

More from flashfashioncasualwe (20)

How does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdfHow does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
 
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfHello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
 
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdfFocus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
 
Decision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdfDecision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdf
 
Explain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdfExplain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdf
 
During a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdfDuring a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdf
 
Explain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdfExplain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdf
 
Describe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdfDescribe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdf
 
Explain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdfExplain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdf
 
Describe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdfDescribe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdf
 
All answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdfAll answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdf
 
C programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfC programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdf
 
Add to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdfAdd to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdf
 
Write an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdfWrite an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdf
 
which of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdfwhich of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdf
 
2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdf2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdf
 
10. Benefits and costs of International Trade Search for a newspap.pdf
10. Benefits and costs of International Trade  Search for a newspap.pdf10. Benefits and costs of International Trade  Search for a newspap.pdf
10. Benefits and costs of International Trade Search for a newspap.pdf
 
Why does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdfWhy does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdf
 
Use the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdfUse the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdf
 
To vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdf
To vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdfTo vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdf
To vaccinate or not to vaccinate Is the influenza Virus vaccine Saf.pdf
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Develop an inventory management system for an electronics store. The .pdf

  • 1. Develop an inventory management system for an electronics store. The inventory system should have the following functionalities .BuildInventory: reada text file containing electronics products information and store them in an array of pointers .Shownventory display all inventory items .ShowDefectInventory: display inventory items that are defective Terminate: to save cument inventory to a text file This lab assignment illustrates the following concepts: -Text file readings and writings .Arrays of pointers and dynamic memory allocations with new and delete Inheritance .C++ type casting: static cast Class Design You need at least three classes class Inventory System: (minimum implementation specified below). This class stores Inyentoryltem objects (which are in fact Inventory item base class pointers to derived Product objects and member functions to manipulate those Product objects as shown below. .Private data members Store Name Store ID ltem List (array of pointers to Inventory Item objects, max of 512) ltem Count (tracking how many items are currently stored in the array) .Constructors (initialize all pointers in the array to NULL in addition to what's described below .Default constructor: set data members to 0 (for integers), 0.0 (for float/double), or NULL (for pointers) as appropriate. Also invoke this function to initialize a seed for the random generator srand (time (NULL), (to be used later by Product class to genearte random values for Product ID. See Code Helper section at the end of the lab specs.) .Non-default constructor: taking a string for store name, an integer for store ID. Call srand as shown above Destructor: de-allocate dynamic memory in the amay off pointers (up to Item Count elements) .Public member functions: BuildInventory: read a text file containing Product records (one Product per line), dynamically allocate Product objects and store the objects in the array ItemList (an array of Inventoryltem pointers). It should also update Item Count as needed Shownventory: display all Products in the inventory. Output must be properly formatted and aligned (usingfield with and floating data with 2 digits after decimal point). Note that if you invoke the Display function using the pointers from the array only Invent tem (base objec) information will be displayed. Extra work is needed to properly display Products (derived objects) information ntory: display only defective Products Terminate: iterate thru the array of pointers to write Product objects in the array to a text file in the same format as they were read in. You may use a different file name for wniting .mutator cessors for store name, store id, and item count Solution /* import com.incors.plaf.*; import com.incors.plaf.kunststoff.*;
  • 2. import com.incors.plaf.kunststoff.themes.*; */ public class MainForm extends JFrame implements WindowListener{ /************************ Variable declaration start **********************/ //The form container variable JPanel Panel1; JDesktopPane Desk1 = new JDesktopPane(); JLabel StatusLabel = new JLabel("Copyright © 2004 by Philip V. Naparan. All Rights Reserved. Visit http://www.naparansoft.cjb.net.",JLabel.CENTER); JLabel BusinessTitleLabel = new JLabel(); Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); String StrBusinesTitle; String DBDriver = "sun.jdbc.odbc.JdbcOdbcDriver"; String DBSource = "jdbc:odbc:NaparansoftInventory"; String DBUserName = "Admin"; String DBPassword = "philip121"; Connection CN; //--Start variable the contains forms FrmCustomer FormCustomer; FrmSupplier FormSupplier; FrmSalesRep FormSalesRep; FrmWarehouse FormWarehouse; FrmProduct FormProduct; FrmInvoice FormInvoice; FrmSplash FormSplash = new FrmSplash(); //--End variable the contains forms Thread ThFormSplash = new Thread(FormSplash); //End the form container variable /********************** End variable declaration start ********************/ /************************ MainForm constructor start **********************/ public MainForm(){ //Set the main form title super("Naparansoft Inventory System version 1.1"); //End set the main form title
  • 3. loadSplashScreen(); //We will dispose now the FormSplash because it is now useless FormSplash.dispose(); //StatusLabel.setBorder(BorderFactory.createTitledBorder("")); StatusLabel.setFont(new Font("Dialog", Font.PLAIN, 12)); StrBusinesTitle = "Your Business Name"; BusinessTitleLabel.setText(StrBusinesTitle); BusinessTitleLabel.setHorizontalAlignment(JLabel.LEFT); BusinessTitleLabel.setForeground(new Color(166,0,0)); //Set the main form properties addWindowListener(this); Desk1.setBackground(Color.gray); Desk1.setBorder(BorderFactory.createEmptyBorder()); //Most fastest drag mode Desk1.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); Panel1 = new JPanel(new BorderLayout()); Panel1.setBackground(Color.gray); Panel1.setBorder(BorderFactory.createLoweredBevelBorder()); Panel1.add(new JScrollPane(Desk1),BorderLayout.CENTER); getContentPane().add(CreateJToolBar(),BorderLayout.PAGE_START); getContentPane().add(Panel1,BorderLayout.CENTER); getContentPane().add(StatusLabel,BorderLayout.PAGE_END); setJMenuBar(CreateJMenuBar()); setExtendedState(this.MAXIMIZED_BOTH); setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); setIconImage(new ImageIcon("images/appicon.png").getImage()); setLocation(0,0); setSize(screen); setResizable(true); setVisible(true); show(); try{ Class.forName(DBDriver); CN = DriverManager.getConnection(DBSource,DBUserName ,DBPassword); }catch(ClassNotFoundException e) { System.err.println("Failed to load driver");
  • 4. e.printStackTrace(); System.exit(1); } catch(SQLException e){ System.err.println("Unable to connect"); e.printStackTrace(); System.exit(1); } //End set the main form properties } /********************** End MainForm constructor start ********************/ /*********************** Custom class creation start **********************/ //Create menu bar protected JMenuBar CreateJMenuBar(){ JMenuBar NewJMenuBar = new JMenuBar(); //Setup file menu JMenu MnuFile = new JMenu("File"); MnuFile.setFont(new Font("Dialog", Font.PLAIN, 12)); MnuFile.setMnemonic('F'); MnuFile.setBackground(new Color(255,255,255)); NewJMenuBar.add(MnuFile); //End setup file menu //Set file sub menu JMenuItem ItmLockApp = new JMenuItem("lock Application"); ItmLockApp.setFont(new Font("Dialog", Font.PLAIN, 12)); ItmLockApp.setMnemonic('L'); ItmLockApp.setIcon(new ImageIcon("images/lockapplication.png")); ItmLockApp.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_L,ActionEvent.CTRL_MASK ) ); ItmLockApp.setActionCommand("lockapp"); ItmLockApp.addActionListener(JMenuActionListener); ItmLockApp.setBackground(new Color(255,255,255)); JMenuItem ItmLoggOff = new JMenuItem("Logg Off");
  • 5. ItmLoggOff.setFont(new Font("Dialog", Font.PLAIN, 12)); ItmLoggOff.setMnemonic('O'); ItmLoggOff.setIcon(new ImageIcon("images/loggoff.png")); ItmLoggOff.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_O,ActionEvent.CTRL_MASK ) ); ItmLoggOff.setActionCommand("loggoff"); ItmLoggOff.addActionListener(JMenuActionListener); ItmLoggOff.setBackground(new Color(255,255,255)); JMenuItem ItmExit = new JMenuItem("Exit"); ItmExit.setFont(new Font("Dialog", Font.PLAIN, 12)); ItmExit.setMnemonic('E'); ItmExit.setIcon(new ImageIcon("images/exit.png")); ItmExit.setAccelerator( KeyStroke.getKeyStroke( KeyEvent.VK_E,ActionEvent.CTRL_MASK ) ); ItmExit.setActionCommand("exit"); ItmExit.addActionListener(JMenuActionListener); ItmExit.setBackground(new Color(255,255,255)); MnuFile.add(ItmLockApp); MnuFile.addSeparator(); MnuFile.add(ItmLoggOff); MnuFile.add(ItmExit); //End set file sub menu //Setup records menu JMenu MnuRec = new JMenu("Records"); MnuRec.setFont(new Font("Dialog", Font.PLAIN, 12)); MnuRec.setMnemonic('R');