PLEASE HELP ME FOR MY PROJECT

Hello.
I have my project to be done by Monday.
I typed some code, but have no idea what to do anymore. No clue...
The following is the project overview etc.
Overview
In a single source file named App.java, define an Employee class to encapsulate employee data and an App class defining an applet to maintain a collection of Employee objects.
Employee Class
Define a small, non-public class named Employee that encapsulates private instance variables for name (String) and pay rate (double). The class needs a single constructor to instantiate an Employee object with values received for both instance variables. It also needs minimal set() and get() methods (such as setName(), getPayRate(), etc.) that allow a class client to store and retrieve the value of each instance variable. Do not be concerned with editing the data within this class. It is used only to support the testing of your applet.
Code this class inside your App.java source file but after the definition of the App class. Be sure to omit the specification of public in the class header (because Java only allows one public class per source file).
App class
This public class will define the processing of your applet. Its required features are as follows:
Input Components:
Name (a TextField). For entering or displaying an employee's name.
Pay rate (a TextField). For entering or displaying an employee's pay rate. When used for input, the value must be edited (see the processing notes below). If the value is invalid, display an appropriate error message.
First (a button). When clicked, triggers the display of the name and pay rate of the first employee in the collection. If the collection is empty, display an appropriate message.
Next (a button). When clicked, triggers the display of the name and pay rate of the next employee in the collection. If there are no more objects in the collection, display an appropriate message.
Find (a button). When clicked, triggers the display of the name and pay rate of the employee whose name currently appears in the name text field. If the requested employee doesn't exist, display an appropriate error message.
Add (a button). When clicked, triggers the construction of an Employee object having the currently displayed name and pay rate and the addition of the object to the collection. Display appropriate error messages if input data is missing or incorrect or if the employee already exists within the collection.
Delete (a button). When clicked, triggers the deletion of the Employee object having the currently displayed name from the collection. If the specified employee doesn't exist, display an appropriate error message.
Output components:
Number of employees (a Label). For displaying how many Employee objects are currently within the collection. This must be changed as employees are added or deleted from the collection.
Message area (a TextArea). For displaying messages.
Processing notes:
The applet must get the value of an HTML parameter named "maxRate". Convert the associated value string to a double and use it to edit a pay rate entered by the user. It represents the maximum allowable pay rate for an employee. If an attempt is made to enter a larger pay rate, display an appropriate error message.
Use GridBagLayout for the applet's components. The arrangement of components is up to you.
Use a SortedMap implemented as a TreeMap for the collection. It is to be maintained in ascending order based upon employee name.
When the user moves the mouse to touch one of the buttons, its color or font should change. When the mouse exits the button, its color or font should return to normal.
The following is the code I have so far
<CODE>
import java.util.*;
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
public class App extends Applet implements ActionListener, MouseListener,
MouseMotionListener{
// Instance variables for the employees' name and pay rate.
private String name;
private double payRate;
// Instance variables for referencing the Employee name heading and its text field.
private Label nameLabel;
private TextField nameField;
// Instance variables for referencing the pay rate heading and its text field.
private Label payRateLabel;
private TextField payRateField;
// Instance variables for referencing the number of employees' heading and
// its text field.
private Label empNumLabel;
private TextField empNumField;
// Instance variables for referencing the "First", "Next", "Find", "Add", and
// "Delete" button.
private Button firstBtn;
private Button nextBtn;
private Button findBtn;
private Button addBtn;
private Button deleteBtn;
// Instance variables for referencing the message area.
private TextArea msg;
public static void main(String[] args){
SortedMap m = new TreeMap();
// This method defines initial (one-time) applet processing.
public void init(){
// Set the size and background/foreground color for the applet window.
setSize(250, 350);
setBackground(Color.lightGray);
setForeground(Color.green);
// Choose GridBagLayout and create a GridBagConstraints object for use in
// laying out components to be added to hte container.
setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
// Initialize constraints to stretch small components to fill their entire
// display area, give all rows equal height when distributing extra vertical
// space, and give all columns equal width when distributing extra horizontal
// space.
c.fill=GridBagConstraints.BOTH;
c.anchor = GridBagConstrainst.CENTER;
c.weightx = 1;
c.weighty = 1;
// Build Employee Name label and add it to the top-left cell in the layout.
nameLabel = new Label ("Employee Name");
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 1;
c.gridheight = 1;
add (nameLabel, c);
// Build Employee Name text field and add it to x=1, y=0 in the layout.
nameField = new TextField (30);
c.gridx = 1;
c.gridy = 0;
c.gridwidth = 1;
// or c.gridwidth = GridBagConstraints.REMAINDER; //Last on row.
c.gridheight = 1;
add (nameField, c);
// Build Pay Rate label and add it to the second row, first column in the layout.
payRateLabel = new Label ("Pay Rate");
c.gridx = 0;
c.gridy = 1;
c.gridwidth = 1;
c.gridheight = 1;
add (payRateLabel, c);
// Build Pay Rate text field and add it to x=1, y=1 in the layout.
payRateField = new TextField (8);
c.gridx = 1;
c.gridy = 1;
c.gridwidth = 1;
// or c.gridwidth = GridBagConstraints.REMAINDER; //Last on row.
c.gridheight = 1;
add (payRateField, c);
// Build number of employee label and add it to x=1, y=2 in the layout.
empNumLabel = new Label ("Number of Employees");
c.gridx = 1;
c.gridy = 2;
c.gridwidth = 1;
c.gridheight = 1;
add(empNumLabel, c);
// Build number of employee text field and add it to x=2, y=2 in the layout.
empNumField = new TextField (5);
c.gridx = 2;
c.gridy = 2;
c.gridwidth = 1;
c.gridheight = 1;
add(empNumField, c);
// Create the "ADD" button and add it to the x=1, y=3 in the layout.
addBtn = new Button ("Add");
addBtn.setBackground(Color.red);
addBtn.setForeground(Color.black);
addBtn.addActionListener(
new ActionListener() {
public void actionPerformed (ActionEvent e){
c.gridx = 1;
c.gridy = 3;
c.gridwidth = 1;
c.gridheight = 1;
add(addBtn, c);
// Create the "DELETE" button and add it to the x=2, y=3 in the layout.
deleteBtn = new Button ("Delete");
deleteBtn.setBackground(Color.red);
deleteBtn.setForeground(Color.black);
deleteBtn.addActionListener(
new ActionListener() {
public void actionPerformed (ActionEvent e){
c.gridx = 2;
c.gridy = 3;
c.gridwidth = 1;
c.gridheight = 1;
add(deleteBtn, c);
// Create the "FIRST" button and add it to the x=0, y=4 in the layout.
firstBtn = new Button ("First");
firstBtn.setBackground(Color.red);
firstBtn.setForeground(Color.black);
firstBtn.addActionListener(
new ActionListener() {
public void actionPerformed (ActionEvent e){
c.gridx = 0;
c.gridy = 4;
c.gridwidth = 1;
c.gridheight = 1;
add(firstBtn, c);
// Create the "NEXT" button and add it to the x=1, y=4 in the layout.
nextBtn = new Button ("Next");
nextBtn.setBackground(Color.red);
nextBtn.setForeground(Color.black);
nextBtn.addActionListener(
new ActionListener() {
public void actionPerformed (ActionEvent e){
c.gridx = 1;
c.gridy = 4;
c.gridwidth = 1;
c.gridheight = 1;
add(nextBtn, c);
// Create the "FIND" button and add it to the x=2, y=4 in the layout.
findBtn = new Button ("Find");
findBtn.setBackground(Color.red);
findBtn.setForeground(Color.black);
findBtn.addActionListener(
new ActionListener() {
public void actionPerformed (ActionEvent e){
c.gridx = 2;
c.gridy = 4;
c.gridwidth = 1;
c.gridheight = 1;
add(findBtn, c);
// Create message are and add it to x=0, y=5 in the layout.
msg = new TextArea (5, 20);
c.gridx = 0;
c.gridy = 5;
c.gridwidth = GridBagConstraints.REMAINDER; // Last on row
c.gridheight = 1;
add(msg, c);
//???????????????????????????????????????????????/////////////////////////???????????????????????????????????????????????///////////////////////public void setName (String newName){
name = newName;
public void setPayRate (double newPayRate){
payRate = newPayRate;
public void getName () {
return name;
public void getPayRate() {
return payRate;
//Change color of Button
public void mouseEntered (MouseEvent e){
Color oldBackground = addBtn.getBackground();
addBtn.setBackground(addBtn.getForeground());
addBtn.setForeground(oldBackground);
public void mouseExited (MouseEvent e){
Color oldBackground = addBtn.getBackground();
addBtn.setBackground(addBtn.getForeground());
addBtn.setForeground(oldBackground);
</CODE>
I don't know where to put Employee class.
I don't know what to do anymore...
I'm soooooooooooooo stuck and just want to cry...
Please give me any suggestion/help so that I could move on.
Thank you so much in advance

Step 1 (analying your specs).
In a single source file named App.java, define an Employee class to encapsulate employee data and an App class defining an applet to maintain a collection of Employee objects.
You are given lots of usefule information.
Name of the primary (source) class to create App
Primary class (source) will include an employee class.
The need to maintain a collection (list) of employee classes.
first thing i do is
public class App {
    Vector myEmps = new Vector();// will hold the employee objects;
    Employee emp;      // single instance of an employee object
    App() {
       // this is how we add employee objects to the list
       // in this case the list is a vector.
       myEmps.add(new Employee("sean",1,80000.50));
       myEmps.add(new Employee("davey",1,70000.25));
       myEmps.add(new Employee("harry",1,90000.15));
class Employee {
// define employee data as variables
   String name;
   int ID;
   double payRate;
      Employee(String n, int ID, double pr) {
        this.name = n;
        this.ID = ID;
        this.payRate = pr;
     public void setName(String n) {  // can set/change emps name
        name = n;
     public void setPayRate(double pr) {  // can set/change payRate
          payRate = pr;
}this is just a start

Similar Messages

  • I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.​Please help me for that.

    I want to check all functions of PCI 6534.I have read the user manual..I have some memory related questions.Please help me for that.
    1.)If i am using the continuous output mode.and the size of generated data is less than 32 MB.If i want to preload the memory,what should i do?I want that first of all i load all my data to onboard memory & then i want to make start the transfer between 6534 & peripheral.Is it possible?As per me it should be.Plz tell me how should i do this?I think that in normal procedure the transfer between 6534-peripheral & outputting data from pc buffer to onboard memory works parallely.But i don't want this.Is it poss
    ible?
    (2).Similarly in finite input operation(pattern I/O) is it possible to preload the memory and then i read it?Because i think that the PC memory will be loaded automatically when 6534 acquires the data and then when we use DIO read vi the pc buffer data will be transferred to application buffer.If this is true,i do not want this.Is it possible?
    (3) One more question is there if i am using normal operation onboard memory will be used bydefault right?Now if i want to use DMA and if i have data of 512 bytes to acquire.How will it work and how should i do it?Please tell me the sequence of operations.As per my knowledge in normal DMA operation we have 32 Bytes FIFO is there so after acquisition of 32 bytes only i can read it.How it will known to me that 32 bytes acquisition is complete?Next,If i want to acquire each byte separately using DMA interrupts what should i do?Provide me the name of sourse from which i can get details about onboard memory & DMA process of 6534 specifically
    (4).In 6534 pattern Input mode,if i want to but only 10 bits of data.and i don't want to waste any data line what should i do?

    Hi Vishal,
    I'll try to answer your questions as best I can.
    1) It is definitely possible to preload data to the 32MB memory (per group) and start the acquisition after you have preloaded the memory. There are example programs on ni.com/support under Example Code for pattern generation and the 6534 that demonstrate which functions to use for this. Also, if your PC memory buffer is less than 32MB, it will automatically be loaded to the card. If you are in continuous mode however, you can choose to loop using the on-board memory or you can constantly be reading the PC memory buffer as you update it with your application environment.
    2) Yes, your data will automatically be loaded into the card's onboard memory. It will however be transferred as quickly as possible to the DMA FIFO on the card and then transferred to the PC memory buffer through DMA. It is not going to wait until the whole onboard memory is filled before it transfers. It will transfer throughout the acquisition process.
    3) Vishal, searching the example programs will give you many of the details of programming this type of application. I don't know you application software so I can't give you the exact functions but it is easiest to look at the examples on the net (or the shipping examples with your software). Now if you are acquiring 512 bytes of data, you will start to fill your onboard memory and at the same time, data will be sent to the DMA FIFO. When the FIFO is ready to send data to the PC memory buffer, it will (the exact algorithm is dependent on many things regarding how large the DMA packet is etc.).
    4) If I understand you correctly, you want to know if you waste the other 6 bits if you only need to acquire on 10 lines. The answer to this is Yes. Although you are only acquiring 10 bits, it is acquired as a complete word (16bits) and packed and sent using DMA. You application software (NI-DAQ driver) will filter out the last 6 bits of non-data.
    Hope that answers your questions. Once again, the example code on the NI site is a great place to start this type of project. Have a good day.
    Ron

  • HT3986 I installed windows 7 to my macbook pro, but my mousepad does not work in windows 7 and also i can not connect my windows 7 to projector, but i can use my macbook's mouse pad and i can connect my mac to projector,so please help me for windows 7 pro

    I installed windows 7 to my macbook pro, but my mousepad does not work in windows 7 and also i can not connect my windows 7 to projector, but i can use my macbook's mouse pad and i can connect my mac to projector,so please help me for windows 7 problem

    i try to download now, do you think when i download and install the windows support software, can i fix the problem?

  • HT1414 Turn Passcode Off is disabled in my iPod touch 5. Could you please help me for the same ?

    Turn Passcode Off is disabled in my iPod touch 5. Could you please help me for the same ?

    What do yoo mean?

  • HT4436 I am using IOS 4.1 in Ipod touch. I would like to take my data back using icloud. I am not able to enable icloud in to my ipod touch. please help me for the same.

    I am using IOS 4.1 in Ipod touch. I would like to take my data back using icloud. I am not able to enable icloud in to my ipod touch. please help me for the same. Basically I am trying to take back to upgrade my ios to 5 or 6 version.

    You can't back up to iCloud until you update to iOS 5 or higher.  You will have to back up your iPod on your computer using iTunes.  Update iTunes on your computer to the latest version, then connect your iPod to your computer, open iTunes, if iTunes give you a pop-up asking if you want to update your iPod, decline.  Then click on the name of your iPod in iTunes, go to File>Devices>Transfer Purchases to transfer any purchased media to your iTunes library.  Next, go to the Summary tab of your iTunes sync settings and click on Back Up Now to back up your iPod on your computer.
    When it's done backing up, click on Check for Update (or Update) on the Summary tab of your iTunes sync settings.  Allow your iPod to update, and leave it connected to your computer.  At the end, it will restart and give you the option to restore to the iTunes backup you made earlier.  Choose this option to restore your backup and sync your apps and other iTuens media to your phone.
    This process is outlined in this article: http://support.apple.com/kb/HT4972, under "If you are attempting to update using a Mac or PC with which you normally sync".

  • Please , help me for apple id.......  i made new id but there is a credite card option and that's why i am not able to download any free application for iphone,.....so,.....what i do about this problem..???

    please , help me for apple id.......  i made new id but there is a credite card option and that's why i am not able to download any free application for iphone,.....so,.....what i do about this problem..???

    You can create an Apple ID without a credit card by following this guide exactly: http://support.apple.com/kb/ht2534.  Note that you have to start by downloading a free app, then create the ID.

  • Please help i started my project video format 720HD resolution 12x720 rate 25p at last when i finish and burn to dvd the edges are cut off any one help please i am really in trouble

    please help i started my project with  video format 720HD, resolution 12x720, rate 25p.  at last when i finish and burn to dvd the edges are cut off and my logo cut off the screeen aswell any one help please i am really in trouble. thanks

    Sorry, but I don't know anything about that app.
    I did go to their Web site and I see they have a support link. Perhaps you can get help there or in their forum.
    If you are OK with a DVD with a basic menu, you could try the Share>DVD option in FCP.
    Good luck.
    Russ

  • I need make mac browsers with windows compatibility, because if i try to se priview from Dw to all browsers on windows PC it will look fine, but same file i trying to see on mac all browsers it will not showing proper..... Please help me for that.

    i need make mac browsers with windows compatibility, because if i try to se priview from Dw to all browsers on windows PC it will look fine, but same file i trying to see on mac all browsers it will not showing proper..... Please help me for that.

    ASk in the DW firum and be much more specific. Web page rendering issues are specific to specific versions of browsers and you may simply be using some bad code that messes up your page.
    Mylenium

  • TS1292 Please help me for, I don't have any code to redeem applications or to update application

    Please help me for I don't have any code to redeem application or update applications

    What 'redeem code' are you expecting, and why do you think that you need one ? iTunes gift cards are country-specific (they can only be redeemed/used in the country in which they were issued), if they aren't available in your country then you won't be able to get one. You shouldn't need a gift code in order to update an app.

  • I'm unable to play game in hp 15-r009TU.. what can i do for this. please help me for this

    i'm unable to play game in hp 15-r009TU.. what can i do for this. please help me for this

    Hi Madhuama, I'll try to give you a hand with this. First off, what OS is running on your notebook, what game are you attempting to play, and how is it not working? Is it not installing?
    Thanks,
    Fenian Frank
    I work on behalf of HP

  • Hi please help me for my blackberry 8900

    hi please help me for my blackberry 8900 reload software. i make a password but stil not working now the screen is all white and the writen only is reload software 513....please help me

    Hi bheth_16,
    Welcome to BlackBerry Support Community Forums.
    Try backing up your device via the BlackBerry Desktop Software and performing a clean reload of your device software. http://bbry.lv/bpv7DT
    If the Desktop Software is unable to connect to your BlackBerry, try the following:
    1. Verify that the BlackBerry Desktop Manager and BlackBerry Device Software are installed on the computer.
    2. Remove the battery from the BlackBerry. Do not re-insert.
    3. Connect the BlackBerry to the computer.
    4. On the BlackBerry Desktop Manager main screen, click Application Loader.
    5. Click Start.
    6. Click Options to add or remove applications.
    7. Click Next.
    8. Click Next.
    9. Click Finish.
    10. When the application load starts, insert the battery into the BlackBerry smartphone.
    This will remove all personal data from your BlackBerry. To restore your data you will need a previously taken backup file.
    -FS
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click Solution? for posts that have solved your issue(s)!

  • I want to transfer my Adobe CS3 licence to my new Laptop. Please help me for Deactivate Adobe CS3 licence from old Laptop

    I want to transfer my Adobe CS3 licence to my new Laptop.
    Please help me for Deactivate Adobe CS3 licence from old Laptop

    Hi sanket chalke,
    I'm not sure what Adobe product you need help with, but you might want to start with this document, which has deactivation information: Activation & Deactivation Help
    Please let us know how it goes.
    Best,
    Sara

  • I forgot restrictions cod in ipad air1 and don't off it , please help me for recovery this cod

    i forgot restrictions cod in ipad air1 and don't off it , please help me for recovery this cod...

    Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
    A
    1. iOS- Forgotten passcode or device disabled after entering wrong passcode
    2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
    3. Restoring iPod touch after forgotten passcode
    4. What to Do If You've Forgotten Your iPhone's Passcode
    5. iOS- Understanding passcodes
    6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
    7. iOS - Unable to update or restore
    Forgotten Restrictions Passcode Help
                iPad,iPod,iPod Touch Recovery Mode
    You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
    You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
    Also, see iTunes- Restoring iOS software.
    And also see How to Recover Forgotten iPhone, iPad Restrictions Passcode.

  • When i run installation itunes,i see this massage "there is a problem with this windows installer package.a program required for this install to complete could not be run. contact your support personnel or package vendor."please help me for installation i

    when i run installation itunes,i see this massage "there is a problem with this windows installer package.a program required for this install to complete could not be run. contact your support personnel or package vendor."please help me for installation itunes on my pc completely.

    Apparently it's an itunes issue. I just tried to update and got the same issue. Called att to activate my iphone 4s and they say they can do the swap but apple is telling them itunes is down atm.  So will have to wait

  • Please Help! For some reason when ever I type in PSE it comes out very faint and almost invisable???

    Please Help! For some reason when ever I type in PSE 10 it comes out very faint and almost invisable like. I'm not sure what I did but I cant get it back to the normal black font??? Please help. I know this seems like a very simple and easy question. I could use any advise. I've tried everything.

    Further to what dominic said, in PSE 11 and 12, you get to Reset Tool by clicking the four-lined square on the upper right of the Tool Options area. In older versions, click the tiny triangle or tool icon at the far left of the Options Bar.

Maybe you are looking for