The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Java Help
|
Homework - Help me fast
Discuss Help me fast in the Java Help forum on Dev Shed. Help me fast Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

April 24th, 2012, 01:01 PM
|
|
Registered User
|
|
Join Date: Apr 2012
Posts: 5
Time spent in forums: 45 m 35 sec
Reputation Power: 0
|
|
Homework - Help me fast
i need help and i need it fast
the subject is that my friend need a help with his assignment in Java but he don't know that much in Java and he need the result today it is a real deal the assignment is like this
A personnel system in a company stores the following fields for each employee record:
- Empolyee_Record:
1-Name.
2-EMP_Number.
3-Birth_date.
4-Salary_Amount.
Create a complete java program that enables you to do the following:
1 Store 30 Empolyee_Records in an array of data type object.
2 Perform the following array operations:
3.1 Insert a new Employee record .
3.2 Delete an Employee record.
3.3 Search for an Employee record using the Binary search method.
3.4 Search for an Employee record using the linear search method.
3.6 Display a selected Empolyee_Record or records.
3.7 Sort the records using Merging algorithm.
3 Use a suitable Frame; create a MENU for the array operations.
and i am realy sorry for interrupt you and if it OK with you i need it today
thank you very much
this assignment must be submet it tmorrow so can you help me pleas?? 
|

April 24th, 2012, 01:59 PM
|
 |
Contributing User
|
|
Join Date: Aug 2010
Location: Eastern Florida
|
|
|
Do you have any specific java programming questions about your assignment?
Please post your code and question.
|

April 24th, 2012, 08:01 PM
|
|
Registered User
|
|
Join Date: Apr 2012
Location: Germany
Posts: 4
Time spent in forums: 20 m 36 sec
Reputation Power: 0
|
|
Quote: | Originally Posted by NormR Do you have any specific java programming questions about your assignment?
Please post your code and question. |
This, post all your information about your assignment. I can't really understand what you want, and what you have at the moment.
|

April 24th, 2012, 08:09 PM
|
|
Registered User
|
|
Join Date: Apr 2012
Posts: 5
Time spent in forums: 45 m 35 sec
Reputation Power: 0
|
|
|
you whant the truth i need help from zero because i dont know how to do it at all
|

April 24th, 2012, 08:33 PM
|
 |
Contributing User
|
|
Join Date: Aug 2010
Location: Eastern Florida
|
|
|
What do you have now? Post your current code and questions.
|

April 24th, 2012, 08:46 PM
|
 |
kill 9, $$;
|
|
Join Date: Sep 2001
Location: Shanghai, An tSín
|
|
Quote: | Originally Posted by hope aa you whant the truth i need help from zero because i dont know how to do it at all |
Ok, so you need to break it down step-by-step.
Quote: | 1 Store 30 Empolyee_Records in an array of data type object. |
So the first thing is: do you know how to create an array?
|

April 24th, 2012, 10:06 PM
|
|
Registered User
|
|
Join Date: Apr 2012
Posts: 5
Time spent in forums: 45 m 35 sec
Reputation Power: 0
|
|
|
i have this programe and i have many question
the programe:
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;
import javax.swing.border.*;
import java.util.Scanner;
public class Assignment4 extends JFrame {
static PrintWriter output1 , output2, output3;
static CoursePanel cpanel = new CoursePanel();
static JTextArea arr=new JTextArea(30,40);
static JLabel jblSGR = new JLabel(" Gender ");
static JLabel jblSMJ = new JLabel("Choice ");
static String[] Gender = {"Male","Female"};
static JComboBox jcbSGR = new JComboBox(Gender);
static JComboBox jcbSMJ = new JComboBox(new String[]{"insert","delete","Binary search","Linear search"});
static JButton jbtSave = new JButton("Save");
static JButton jbtCancel = new JButton("Cancel");
static JButton jbtExit = new JButton("Exit");
static JPanel jpMain1, jpMain3;
static Assignment4 frame;
/** Main method */
public static void main(String[] args) throws Exception {
frame = new Assignment4();
frame.pack();
frame.setTitle("College of Applied Sciences - Sohar");
frame.setLocationRelativeTo(null); // Center the frame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
final JButton print = new JButton("print");
final JButton c = new JButton("cancel");
final JPanel button = new JPanel();
button.add(print);
button.add(c);
final JPanel qq = new JPanel();
JLabel q = new JLabel(" Do you want to print Data Of Student? ");
qq.add(q);
// Register listener
jcbSMJ.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
setDisplay(jcbSMJ.getSelectedIndex());
}
});
jbtSave.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
c.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(0);
}});
}
});
jbtCancel.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
CoursePanel.jtfC1.setText(null);
CoursePanel.jtfC2.setText(null);
CoursePanel.jtfC3.setText(null);
CoursePanel.jtfC4.setText(null);
}
});
}
public Assignment4() {
// Create a new panel to hold label and text field
jpMain1 = new JPanel();
JPanel jpMain11 = new JPanel();
JPanel jpMain12 = new JPanel();
jpMain3 = new JPanel();
jpMain3.setLayout(new BorderLayout());
JPanel jpMain31 = new JPanel();
jpMain31.setLayout(new FlowLayout());
jpMain31.add(jbtSave);
jpMain31.add(jbtCancel);
jpMain31.add(jbtExit);
JPanel jpMain32 = new JPanel();
final JLabel jblMessage = new JLabel(" ");
jpMain32.add(jblMessage);
jpMain3.add(jpMain31,BorderLayout.NORTH);
jpMain3.add(jpMain32,BorderLayout.CENTER);
jpMain1.setLayout(new BorderLayout(5,0));
jpMain11.setLayout(new FlowLayout(FlowLayout.LEFT));
jpMain12.setLayout(new FlowLayout(FlowLayout.LEFT));
jpMain11.add(arr);
jpMain12.add(jblSGR);
jpMain12.add(jcbSGR);
jpMain12.add(jblSMJ);
jpMain12.add(jcbSMJ);
jpMain1.add(jpMain11,BorderLayout.NORTH);
jpMain1.add(jpMain12, BorderLayout.CENTER);
setDisplay(0);
setLayout(new BorderLayout());
add(jpMain1,BorderLayout.NORTH);
add(cpanel,BorderLayout.CENTER);
add(jpMain3,BorderLayout.SOUTH);
}
static void setDisplay(int index){
if (index == 0){
cpanel.setTitle1("ID","NAME","SALARY","BIRTH DATE");
cpanel.setBorder(new TitledBorder("INSERT"));
}
else if (index == 1){
cpanel.setTitle11("POSITION");
cpanel.setBorder(new TitledBorder("DELETE"));
}
else if (index == 2){
cpanel.setTitle2("TARGET");
cpanel.setBorder(new TitledBorder("BINARY SEARCH"));
}
else if (index == 2){
cpanel.setTitle2("TARGET");
cpanel.setBorder(new TitledBorder("LINEAR SEARCH"));
}
}
}
class CoursePanel extends JPanel{
JLabel jblC1 = new JLabel();
JLabel jblC2 = new JLabel();
JLabel jblC3 = new JLabel();
JLabel jblC4 = new JLabel();
static JButton insert = new JButton("Insert");
static JButton delete = new JButton("Delete");
static JButton binary = new JButton("search1");
static JButton linear = new JButton("search2");
static JTextField jtfC1 = new JTextField(1);
static JTextField jtfC2 = new JTextField(1);
static JTextField jtfC3 = new JTextField(1);
static JTextField jtfC4 = new JTextField(1);
private Component add;
public CoursePanel(){
setLayout(new GridLayout(6,5));
add(jblC1);
add(jtfC1);
add(jblC2);
add(jtfC2);
add(jblC3);
add(jtfC3);
add(jblC4);
add(jtfC4);
add(insert);
add(delete);
add(binary);
add(linear);
}
public void setTitle11(String title1) {
jblC1.setText(title1);
insert.add(insert);
jtfC2.setEditable(false);
jtfC3.setEditable(false);
jtfC4.setEditable(false);
}
public void setTitle1(String title1,String title2,String title3, String title4){
jblC1.setText(title1);
jblC2.setText(title2);
jblC3.setText(title3);
jblC4.setText(title4);
jtfC4.setEditable(true);
}
public void setTitle2(String title1){
jblC1.setText(title1);
jtfC2.setEditable(false);
jtfC3.setEditable(false);
jtfC4.setEditable(false);
repaint();
}
}
my question is when i clik insert button i whant to save information in array and thin retrive it in textArea
and if i whant to delete what i inert how can i do that????
|

April 24th, 2012, 11:53 PM
|
 |
kill 9, $$;
|
|
Join Date: Sep 2001
Location: Shanghai, An tSín
|
|
|
IMO you're doing this backwards. I'd suggest taking the steps in the same order as in the assignment. The UI should be the last thing you add after you've developed the mechanism to store the Employee objects and perform your array operations.
|

April 25th, 2012, 12:40 AM
|
|
Registered User
|
|
Join Date: Apr 2012
Posts: 5
Time spent in forums: 45 m 35 sec
Reputation Power: 0
|
|
|
it does not mater any mor what i want is how to save user input in array after cliking save or insert
|

April 25th, 2012, 12:53 AM
|
|
Registered User
|
|
Join Date: Apr 2012
Posts: 5
Time spent in forums: 45 m 35 sec
Reputation Power: 0
|
|
|
i have all the operation put i cant compin them together thats the problem
can yuo help pleas it is ergent
|

April 25th, 2012, 05:54 AM
|
 |
Contributing User
|
|
Join Date: Aug 2010
Location: Eastern Florida
|
|
|
If you are getting compiler errors, please copy and paste them here if you want help fixing them.
Please edit your post and wrap the code in code tags. Use the Go Advanced button and then the #icon above the input box.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|