SlideShare a Scribd company logo
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 Representation
Randy Connolly
 
Intake 38 data access 5
Intake 38 data access 5Intake 38 data access 5
Intake 38 data access 5
Mahmoud Ouf
 
Local data storage for mobile apps
Local data storage for mobile appsLocal data storage for mobile apps
Local data storage for mobile apps
Ivano 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_a4
openerpwiki
 
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.1
Arun 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 Clients
Salesforce 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
 
Intake 37 ef2
Intake 37 ef2Intake 37 ef2
Intake 37 ef2
Mahmoud Ouf
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
jlshare
 
Readme
ReadmeReadme
Readme
rec2006
 
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
TawnaDelatorrejs
 
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 apps
Ivano 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.pdf
alokindustries1
 
Salesforce
SalesforceSalesforce
Salesforce
maheswara reddy
 
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.pdf
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 
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
flashfashioncasualwe
 

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

special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
CarlosHernanMontoyab2
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Atul Kumar Singh
 

Recently uploaded (20)

special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Guidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th SemesterGuidance_and_Counselling.pdf B.Ed. 4th Semester
Guidance_and_Counselling.pdf B.Ed. 4th Semester
 

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');