Question

In: Computer Science

You are a software development employee at a startup company. Your HR department has tasked the...

You are a software development employee at a startup company. Your HR department has tasked the IT department with developing a simple application (Windows Form Application) to load and display employee records.

Your application will need to do the following:

Create an Employee Class with the following properties:

First Name

Last Name

Street Address

City

State

Zip

Create a sub class for Managers which inherits from the Employee Class. The Manager class will have the following additional properties:

Cost Center

Supervisor

Create a sub class for Developers which inherits from the Employee Class. The Developer class will have the following additional properties:

Developer Type (Script, .NET, Mobile, etc.)

Supervisor

Tax Type (W2, 1099-Contract)

Load employee information from a text file selected by the user into an array consisting of Managers and Developers. The format of your text file should be something like this:

First Name, Last Name, Street Address, City, State, Zip, Employee Type (Manager or Developer), Cost Center (0 if Developer), Supervisor, Tax Type (NA if Manager)

There should be a separate line for each employee (only one line per employee with the fields above) and your file should contain at least 7 - 10 employee records. You should save the file with a .txt or .csv extension.

The UI should allow the user to select how many records to view (start at 3 and allow up to the total number of records loaded).

The following requirements detail the critical elements that will determine the grading criteria for your submission. Please see the rubric below these requirements.

The application should compile and run successfully

The application should display Inheritance (Steps 1 - 3 above).

The application should allow the user to load a text or csv file for processing (Step 4 above).

The application should load the text file elements into an array of employee records (Step 4 & 4a above).

The application should display records from the array. The number of records to display should be selected by the user. (Step 5 above).

Your application should contain comments to explain the data and process flow of your code.

Solutions

Expert Solution


import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

import java.sql.*;

public class empform extends JFrame implements ActionListener
{

JLabel labl1, labl2, labl3, labl4, labl5, labl6, labl7, labl8;

JTextField txtf1, txtf2, txtf5, txtf6, txtf7;

JButton buton1, buton2;

JPasswordField p1, p2;

empform()
{

setVisible(true);

setSize(700, 700);

setLayout(null);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

setTitle("empform Form in Java");

labl1 = new JLabel("empform Form in Windows Form:");

labl1.setForeground(Color.blue);

labl1.setFont(new Font("Serif", Font.BOLD, 20));

labl2 = new JLabel("Name:");

labl3 = new JLabel("Email-ID:");

labl4 = new JLabel("Create Passowrd:");

labl5 = new JLabel("Confirm Password:");

labl6 = new JLabel("Country:");

labl7 = new JLabel("State:");

labl8 = new JLabel("Phone No:");

txtf1 = new JTextField();

txtf2 = new JTextField();

p1 = new JPasswordField();

p2 = new JPasswordField();

txtf5 = new JTextField();

txtf6 = new JTextField();

txtf7 = new JTextField();

buton1 = new JButton("Submit");

buton2 = new JButton("Clear");

buton1.addActionListener(this);

buton2.addActionListener(this);

labl1.setBounds(100, 30, 400, 30);

labl2.setBounds(80, 70, 200, 30);

labl3.setBounds(80, 110, 200, 30);

labl4.setBounds(80, 150, 200, 30);

labl5.setBounds(80, 190, 200, 30);

labl6.setBounds(80, 230, 200, 30);

labl7.setBounds(80, 270, 200, 30);

labl8.setBounds(80, 310, 200, 30);

txtf1.setBounds(300, 70, 200, 30);

txtf2.setBounds(300, 110, 200, 30);

p1.setBounds(300, 150, 200, 30);

p2.setBounds(300, 190, 200, 30);

txtf5.setBounds(300, 230, 200, 30);

txtf6.setBounds(300, 270, 200, 30);

txtf7.setBounds(300, 310, 200, 30);

buton1.setBounds(50, 350, 100, 30);

buton2.setBounds(170, 350, 100, 30);

add(labl1);

add(labl2);

add(txtf1);

add(labl3);

add(txtf2);

add(labl4);

add(p1);

add(labl5);

add(p2);

add(labl6);

add(txtf5);

add(labl7);

add(txtf6);

add(labl8);

add(txtf7);

add(buton1);

add(buton2);

}

public void actionPerformed(ActionEvent e)
{

if (e.getSource() == buton1)
{

int x = 0;

String str1 = txtf1.getText();

String str2 = txtf2.getText();

char[] s3 = p1.getPassword();

char[] s4 = p2.getPassword();

String s8 = new String(s3);

String s9 = new String(s4);

String s5 = txtf5.getText();

String s6 = txtf6.getText();

String s7 = txtf7.getText();

if (s8.equals(s9))
{

try
{

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection con = DriverManager.getConnection("jdbc:oracle:thin:@mcndesktop07:1521:xe", "sandeep", "welcome");

PreparedStatement ps = con.prepareStatement("insert into reg values(?,?,?,?,?,?)");

ps.setString(1, str1);

ps.setString(2, str2);

ps.setString(3, s8);

ps.setString(4, s5);

ps.setString(5, s6);

ps.setString(6, s7);

ResultSet rs = ps.executeQuery();

x++;

if (x > 0)
{

JOptionPane.showMessageDialog(buton1, "Data Saved Successfully");

}

}
catch (Exception ex)
{

System.out.println(ex);

}

}
else
{

JOptionPane.showMessageDialog(buton1, "Password Does Not Match");

}

}
else
{

txtf1.setText("");

txtf2.setText("");

p1.setText("");

p2.setText("");

txtf5.setText("");

txtf6.setText("");

txtf7.setText("");

}

}

public static void main(String args[])
{

new empform();

}

}


Related Solutions

Your company is tasked with creating software for a home security system.
1. Consider the following:Your company is tasked with creating software for a home security system. The software helps manage all the security cameras and devices installed in the house, relays communications between all parties, and provides a “dashboard” mechanism for homeowners and security personnel to access and monitor.Develop 8 to 10 requirements concerning this scenario.2. What is a “recommendation system” and how can it assist in requirements engineering? What tools can be used to assist in requirements gathering?
You are the HR manager for a new company and you have been tasked with developing...
You are the HR manager for a new company and you have been tasked with developing a concise employee manual for your new middle managers. This manual must help the managers understand certain HR initiatives so that they can recruit, select, and manager their staff effectively. The manual will consist of explaining and providing guidelines for best practices in the areas below. Explain the importance of a job description and briefly describe the necessary components Describe an effective recruiting process...
Suppose you work for the HR department at a multinational company. Your company recently decides to...
Suppose you work for the HR department at a multinational company. Your company recently decides to send managers to the following 4 countries: Japan, England, Hong Kong, and Mexico. Your team is asked to suggest potential candidates and formulate a compensation policy for the expatriate managers. Furthermore, you need to provide training for the expatriate managers. What do you see the main HR-related challenges when sending managers overseas? How would you choose potential managers for each country? Why? What are...
You work in HR Department at the headquarters of a multinational corporation. Your company is about...
You work in HR Department at the headquarters of a multinational corporation. Your company is about to send several Canadian managers overseas as expatriates. Utilize resources available (including class materials) regarding expatriate life, compile a checklist of concerns and steps your company to go through before sending its managers overseas. 2. Use your knowledge from the class “HR management in Global Context” and research materials and present in a form of Essay:   Solution
C++ Programming Enum - Structure - Array You are asked to develop software for HR department...
C++ Programming Enum - Structure - Array You are asked to develop software for HR department to calculate employee’s weekly salary. The program should contain the following information about a student by declaring a struct: Name (string of characters)        Employee ID (string of characters)        Level (ENGINEER, MANGER, DIRECTOR)        Hourly Rate (floating-point number)        Working Hours (floating-point number)        Weekly Salary (floating-point number) Your program will read an employee data and print the information of employee’s Name, Employee...
Imagine you are in HR department and HR manager has advised you to design a basic...
Imagine you are in HR department and HR manager has advised you to design a basic framework which will eventually lead to the development of recruitment, selection and induction policies. The framework can be in the form of flowchart or diagram with relevant explanations. Design the framework and attach with your assessment answers.
You are the project manager of a software development company. Your company receives supplies of chips...
You are the project manager of a software development company. Your company receives supplies of chips from a foreign supplier. Their sales manager has approached you to inform you that if you can increase your order by 30%, the shipment will be free for your organization. This however will bring additional cost of $100 on your current budget that is $5000 p.a. What type of Risk is this? Identify at least three things you can do in response given consideration...
Imagine that you are the Director of the HR Department at your current organization or an...
Imagine that you are the Director of the HR Department at your current organization or an organization with which you are familiar. You are responsible for delegating duties to your team for the selection, development, and management of both the new and current employees. You must ensure that your organization is diverse and follows all employment laws. (Note: You may create and / or make all necessary assumptions needed for the completion of these assignments. In your original work, you...
3.You are the project manager of a software development company. Your company receives supplies of chips...
3.You are the project manager of a software development company. Your company receives supplies of chips from a foreign supplier. Their sales manager has approached you to inform you that if you can increase your order by 30%, the shipment will be free for your organization. This however will bring additional cost of $100 on your current budget that is $5000 p.a. What type of Risk is this? Identify at least three things you can do in response given consideration...
Computer Dynamics (p. 175 of your textbook) is a microcomputer software development company that has a...
Computer Dynamics (p. 175 of your textbook) is a microcomputer software development company that has a 300-computer network. The company is located in three adjacent five-story buildings in an office park, with about 100 computers in each building. The LANs in each building are similar, but one building has the data center on the second floor. There are no other office locations. The current network is poorly designed for its current needs and must be completely replaced. 1. Develop a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT