Objectives Developing a graphical user interface in programming is paramount to
ID: 3804644 • Letter: O
Question
Objectives
Developing a graphical user interface in programming is paramount to being successful in the business industry. This project incorporates GUI techniques with other tools that you have learned about in this class.
Here is your assignment: You work for a flooring company. They have asked you to be a part of their team because they need a computer programmer, analyst, and designer to aid them in tracking customer orders. Your skills will be needed in creating a GUI program that calculates the flooring cost and stores the order in the database.
The project has three components: an analysis and design document, the project code, and a user manual. The analysis and design document is due Week 4. The code and user manual are due in Week 7. It is suggested that you begin working on the code in Week 5, which should give you ample time to complete the project. You will find that the lessons and lab assignments will prepare you for the Course Project.
Guidelines
Your application must include at least three tabs. The user will choose wood flooring or carpet, enter the length and width of the floor, as well as the customer name and address. The application will compute the area of the floor and the cost of the flooring considering that wood floor is $20 per square foot and carpet is $10 per square foot. A summary should be displayed, either in a tab or another window, listing the customer name and address, floor selection, area, and cost. This information should also be stored in the MySQL database table. The program should validate that all information is entered and that the length and width are numeric values. Any numeric or currency values must be formatted appropriately when output. Recommendations for the components used for input are
radio buttons—flooring type (wood or carpet);
text fields—customer name, customer address, floor length, and floor width; and
buttons—calculate area, calculate cost, submit order, display order summary, display order list.
The MySQL database table is called flooring and has the following description.
Field
Type
CustomerName
varchar(30)
CustomerAddress
varchar(50)
FlooringType
varchar(10)
FloorArea
double
FloorCost
double
In addition to entering new customer orders, your application should list all customer orders stored in the database. These will be viewed as a list, in a text area, and will not be updated by the user.
Analysis and Design Document (Due Week 4)
In Week 4, you will complete the analysis and design for the project. You will use the guidelines described above and the grading rubric below to complete this document. You will create the following items.
Request for new application
Problem analysis
List and description of the requirements
Interface storyboard or drawing
Design flowchart or pseudocode
The analysis and design document will be a single MS Word document, which contains all descriptions and drawings. See the grading rubric below for the analysis and design document, due in Week 4.
Item
Points
Description
Request for New Application
2.5
A table containing: date of the request, name of the requester (your professor), the purpose of the request, the title of the application (create your own title), and brief description of the algorithms used in the application
Problem Analysis
2.5
Analyze the problem to be solved, and write in a few words what is the problem and what is being proposed to solve the problem
List and Description of Requirements
5
A description of the items that will be implemented in order to construct the proposed solution
Interface Storyboard or Drawing
5
A picture or drawing of what the application will look like; must include the image of each section of the application in detail
Design Flowchart or Pseudocode
5
A sketch of the flow of the application or the pseudocode of the application
Total
20
Meets or exceeds expectations
Objectives
Developing a graphical user interface in programming is paramount to being successful in the business industry. This project incorporates GUI techniques with other tools that you have learned about in this class.
Here is your assignment: You work for a flooring company. They have asked you to be a part of their team because they need a computer programmer, analyst, and designer to aid them in tracking customer orders. Your skills will be needed in creating a GUI program that calculates the flooring cost and stores the order in the database.
The project has three components: an analysis and design document, the project code, and a user manual. The analysis and design document is due Week 4. The code and user manual are due in Week 7. It is suggested that you begin working on the code in Week 5, which should give you ample time to complete the project. You will find that the lessons and lab assignments will prepare you for the Course Project.
Guidelines
Your application must include at least three tabs. The user will choose wood flooring or carpet, enter the length and width of the floor, as well as the customer name and address. The application will compute the area of the floor and the cost of the flooring considering that wood floor is $20 per square foot and carpet is $10 per square foot. A summary should be displayed, either in a tab or another window, listing the customer name and address, floor selection, area, and cost. This information should also be stored in the MySQL database table. The program should validate that all information is entered and that the length and width are numeric values. Any numeric or currency values must be formatted appropriately when output. Recommendations for the components used for input are
radio buttons—flooring type (wood or carpet);
text fields—customer name, customer address, floor length, and floor width; and
buttons—calculate area, calculate cost, submit order, display order summary, display order list.
The MySQL database table is called flooring and has the following description.
Field
Type
CustomerName
varchar(30)
CustomerAddress
varchar(50)
FlooringType
varchar(10)
FloorArea
double
FloorCost
double
In addition to entering new customer orders, your application should list all customer orders stored in the database. These will be viewed as a list, in a text area, and will not be updated by the user.
Analysis and Design Document (Due Week 4)
In Week 4, you will complete the analysis and design for the project. You will use the guidelines described above and the grading rubric below to complete this document. You will create the following items.
Request for new application
Problem analysis
List and description of the requirements
Interface storyboard or drawing
Design flowchart or pseudocode
The analysis and design document will be a single MS Word document, which contains all descriptions and drawings. See the grading rubric below for the analysis and design document, due in Week 4.
Item
Points
Description
Request for New Application
2.5
A table containing: date of the request, name of the requester (your professor), the purpose of the request, the title of the application (create your own title), and brief description of the algorithms used in the application
Problem Analysis
2.5
Analyze the problem to be solved, and write in a few words what is the problem and what is being proposed to solve the problem
List and Description of Requirements
5
A description of the items that will be implemented in order to construct the proposed solution
Interface Storyboard or Drawing
5
A picture or drawing of what the application will look like; must include the image of each section of the application in detail
Design Flowchart or Pseudocode
5
A sketch of the flow of the application or the pseudocode of the application
Total
20
Meets or exceeds expectations
Explanation / Answer
//Program for GUI based flooring company
import javax.sql.*;
import java.awt.event.*;
import javax.swing.*;
import java.awt.*;
class FlooringCompanyGUI extends JFrame implements ActionListener, ItemListener
{
JTabbedPane jtab;
JRadioButton rdowood,rdocarpet;
JTextField txtcname,txtaddress,txtlength,txtwidth;
JButton btncalculate,btncost,btnsubmitorder,btnordersummary,btnorderlist;
JPanel floorpanel,lwpanel,customerpanel;
JLabel l1,l2,l3,l4;
String floortype;
FlooringCompanyGUI(String title)
{
super(title);
jtab=new JTabbedPane();
floorpanel=new JPanel();
lwpanel=new JPanel();
customerpanel=new JPanel();
floorpanel.add(rdowood=new JRadioButton("Wood"));
floorpanel.add(rdocarpet=new JRadioButton("Carpet"));
lwpanel.add(l1=new JLabel("Enter length : "));
lwpanel.add(txtlength=new JTextField(10));
lwpanel.add(l2=new JLabel("Enter width : "));
lwpanel.add(txtwidth=new JTextField(10));
lwpanel.add(btncalculate=new JButton("Calculate Area"));
lwpanel.add(btncost=new JButton("Calculate Cost"));
lwpanel.add(btnsubmitorder=new JButton("Submit Order"));
customerpanel.add(l3=new JLabel("Enter customer name : "));
customerpanel.add(txtcname=new JTextField(10));
customerpanel.add(l4=new JLabel("Enter customer address : "));
customerpanel.add(txtaddress=new JTextField(10));
customerpanel.add(btnordersummary=new JButton("Order Summary"));
customerpanel.add(btnorderlist=new JButton("Order List"));
jtab.addTab("Floor type",floorpanel);
jtab.addTab("Length & Width ",lwpanel);
jtab.addTab("Customer",customerpanel);
add(jtab);
btncalculate.addActionListener(this);
btncost.addActionListener(this);
btnsubmitorder.addActionListener(this);
btnordersummary.addActionListener(this);
btnorderlist.addActionListener(this);
rdowood.addItemListener(this);
rdocarpet.addItemListener(this);
}
public void itemStateChanged(ItemEvent ie)
{
if(rdowood.isSelected())
floortype="Wood";
else if(rdocarpet.isSelected())
floortype="Carpet";
}
public void actionPerformed(ActionEvent ae)
{
double area=0,cost=0;
String source=ae.getActionCommand();
if(source.equals("Calculate Area"))
{
System.out.println("Hello1");
area=Double.parseDouble(txtlength.getText())*Double.parseDouble(txtwidth.getText());
}
else if(source.equals("Calculate Cost"))
{
System.out.println("Hello2");
if(floortype.equals("Wood"))
cost=area*20;
else if(floortype.equals("Carpet"))
cost=area*10;
}
else if(source.equals("Order Summary"))
JOptionPane.showMessageDialog(null,"Order Summary - Area is :"+area+" Cost is : "+cost,"Information",JOptionPane.INFORMATION_MESSAGE);
else if(source.equals("Order List"))
JOptionPane.showMessageDialog(null,"Order List : Customer name : "+txtcname.getText()+" Address : "+txtaddress.getText()+" Area is :"+area+" Cost is : "+cost,"Information",JOptionPane.INFORMATION_MESSAGE);
}
public static void main(String args[])
{
FlooringCompanyGUI f1=new FlooringCompanyGUI("Customer Project for Flooring");
f1.setSize(new Dimension(500,500));
f1.setVisible(true);
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.