I would like to make a employeemis with using java, what the eror?HELP!

Create a class named Employee. Includes data members for Employee class :
Data member     Data type
Employee id     String
Employee name     String
Icno     String
Gender     Char
Date of birth     String
Address     String
Commencing Date     String
Department     String
Position     String
Salary     Double
Include any relevant methods for example constructor that can perform initialization for all data fields, accessor methods that return each of data field values and mutator method to set values into the data fields. Use a constructor to set each Employee id to 99999 upon object creation.
Write another java application named EmployeeDb. Declare an array of three Employee objects.
Your program should be able to perform the following functions:
(a)     Prompt user to enter three Employees� information from the console and store data in an array
(b)     Search an employee by name.
(c)     Display all employee information by using a loop.
This cannot save file totext file.
So, this is my coding, i try many times but cannot to do search and display..why? who can help me solve it?
Coding:
import java.io.*;
class Employee{
     private int id;
     private String name;
     private String icno;
     private char gender;
     private String dob;
     private String addr;
     private String comdate;
     private String dept;
     private String post;
     private double salary;
     // constructors
     public Employee (int a, String b, String c, char d, String e, String f, String g, String h, String i, double j){
          id = a;
          name = b;
          icno = c;
          gender = d;
          dob = e;
          addr = f;
          comdate = g;
          dept = h;
          post = i;
          salary = j;
     // overloading constructor
     public Employee (int a){
          id = a;
     // setter methods
     public void setID (int a){
          id = a;
     public void setName (String b){
     name = b;
     public void setIcno (String c){
     icno = c;
     public void setGender (char d){
     gender = d;
     public void setDob (String e){
     dob = e;
     public void setAddr (String f){
     addr = f;
     public void setComdate (String g){
     comdate = g;
     public void setDept (String h){
     dept = h;
     public void setPost (String i){
     post = i;
     public void setSalary (double j){
     salary = j;
     // getter methods
     public int getID(){
          return id;
     public String getName(){
          return name;
     public String getIcno(){
          return icno;
     public char getGender(){
          return gender;
     public String getDob(){
          return dob;
     public String getAddr(){
          return addr;
     public String getComdate(){
          return comdate;
     public String getDept(){
          return dept;
     public String getPost(){
          return post;
     public double getSalary(){
          return salary;
     // other methods
     public void displayEmployee(){
          System.out.println("ID          : " +id);
          System.out.println("NAME          : " +name);
          System.out.println("ICNO          : " +icno);
          System.out.println("GENDER          : " +gender);
          System.out.println("DOB          : " +dob);
          System.out.println("ADDRESS     : " +addr);
          System.out.println("COM DATE     : " +comdate);
          System.out.println("DEPT.          : " +dept);
          System.out.println("POST          : " +post);
          System.out.println("SALARY          : " +salary);
/* implementation class */
public class EmployeeMis{
     static Employee emp[]=new Employee[3];
static int recNo;
static int indexNo;
     public static void main(String [] args) throws Exception{
          EmployeeMis mis =new EmployeeMis();
          BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));
          int opt;
          recNo =1000;
          do{
               mis.mainMenu();
               opt=Integer.parseInt(stdin.readLine());
               switch (opt){
               case 1     : mis.addEmployee(); break;
               case 2     : mis.srcEmployee(); break;
               case 3     : mis.dispEmployee(); break;
          }while(opt !=0);
          System.out.println("END OF SYSTEM");
          System.out.println("THANKS YOU");
     public void mainMenu(){
          System.out.println("\n");
          System.out.println("Main Menu");     
          System.out.println(" [1] Add Employee");
          System.out.println(" [2] Search Employee");
          System.out.println(" [3] Display Employee");
          System.out.println(" [0] Exit system");
          System.out.print("Enter selection : ");
     public void addEmployee() throws Exception{
          int id;
          String name;
          String icno;
          char gender;
          String dob;
          String addr;
          String comdate;
          String dept;
          String post;
          double salary;
          BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
          System.out.println("\t\tADD Employee");
          System.out.println("\t\t+++++++++++++");
          System.out.println("\n\n");
          recNo++;
          emp[indexNo] = new Employee(recNo);
          System.out.println("New Employee ID " +recNo );
          System.out.print("Enter Name " );
          name = stdin.readLine();
          System.out.print("Enter IC No " );
          icno = stdin.readLine();
          emp[indexNo].setID(recNo);
          emp[indexNo].setName(name);
          emp[indexNo].setIcno(icno);
          indexNo++;
     public void srcEmployee() throws Exception{
          int id;
          String name;
          String icno;
          char gender;
          String dob;
          String addr;
          String comdate;
          String dept;
          String post;
          double salary;
          char pause;
          int i;
          int found = -1;
          BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
          System.out.println("\tSearch Employee");
          System.out.println("\t==============");
          System.out.print("Enter ID " );
          id = Integer.parseInt(stdin.readLine());
          for(i =0; i < emp.length; i++){
               if (id == emp.getID())
                    found = i;     
          if (found < 0 )
               System.out.println("\n\n\t\t Record Not Found \n\n");
          else{
               System.out.println("Name "+emp[found].getName() );
               System.out.println("IC No "+emp[found].getIcno() );
     public void dispEmployee() throws Exception{
          int id;
          String name;
          String icno;
          char gender;
          String dob;
          String addr;
          String comdate;
          String dept;
          String post;
          double salary;
          int i;
          BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
          System.out.println("t\tDisplay Employee");
          System.out.println("\t\t=============");
          for(i =0; i < emp.length; i++){
               System.out.println("ID "+emp[i].getID() );
               System.out.println("Name "+emp[i].getName() );
               System.out.println("IC No "+emp[i].getIcno() );     
               System.out.println( );     
What the error exactly? Or someone have other method can write? Please help me.. thank you

What do you mean, what's the error? That's for you to tell us. Did you try to compile it and get some error messages? Or do error messages happen when you run it? Or does it just not do what you hoped it would? In any of these three cases, you should be able to copy and paste any error messages here, or tell us what you don't like about its behaviour.
It's impossible for us to run that code, even if we wanted to -- which we don't. You didn't post it in the CODE tags and so it's mangled and unreadable.

Similar Messages

  • I would like to make a screen saver in java.

    I would like to make a screen saver in java. But i do not find in the appropriate documentation classes.
    Can you help me.
    My screen saver may ask a password when the user want to exit it.

    https://jdic.dev.java.net/documentation/incubator/screensaver/
    "The SaverBeans Screensaver SDK (Early Access) is a Java screensaver development kit, enabling developers to create cross-platform screensavers. The developer writes a set of Java classes along with an XML description of the screensaver settings, and uses the tools in this development kit to produce a screensaver for any Java-supported OS. The resulting screensavers behave just like a native screensaver (i.e. with preview capabilities and control over settings)."
    This was found as the first result of a simple google search. You should try it sometime.

  • I have a white unibody macbook 6.1 running 10.6.8 and I would like to upgrade so I can use icloud. what is my best option? as it looks like its too old to run mountain lion? thanks!

    I have a white unibody macbook 6.1 running 10.6.8 and I would like to upgrade so I can use icloud. what is my best option? as it looks like its too old to run mountain lion? thanks!

    They are Safari bookmarks and Snow Leopard Safari will open in Mountain Lion, but won't give you a window?????
    Here are the bookmarks, since I'm now in Snow Leopard:
    http://www.wilmut.webspace.virginmedia.com/notes/icloudmail.html
    http://ihelpyourmac.com/wordpress/?p=23
    http://hints.macworld.com/article.php?story=20111014102515403
    http://hints.macworld.com/article.php?story=20111014102515403
    Advance warning - Mail worked fine.
    I had fits with the last link I posted. At first it worked fine, then all of a sudden, it quit working. I now have iCloud - iCal syncing, but iCal is read only. Not a real big deal since you can log onto iCloud using Safari and post a new event.
    I finally gave up on Address Book because it kept creating multiple contacts, which if you tried to merge or delete the multiple contacts, the contacts were deleted. It also worked at first and then stopped working as it should.

  • HT1918 I am receiving charges and would like to know if you can tell me what the AppleID is that is buying the songs

    I am receiving charges and would like to know if you can tell me what the AppleID is that is buying the songs

    We're just fellow users here and have no access to any information about your account. Nor in most cases will Apple be able to give you such information. If your credit card is being charged for purchases that are not showing in your iTunes Store account's Purchase History, contact your bank and report the charges as fraudulent.
    Regards.

  • Would like to make an ebook with flash videos

    Hello,
    I've written a 110 page book that has 50 one minute flash videos to go with it. I would like to make an e-book with the flash content and sell it over the internet. I would like to put DRM security on it. Could someone suggest what adobe product I should buy to do this?
    Thanks in advance,
    Kidd

    Hi,
    Thanks for the info about DRM. I can't afford it but someone else pointed out Acrobat 9 as the way to go to embed videos.
    .Is this the right forum for questions about Acrobat 9? If not, please point in the right direction and I apologize in advance...
    As I previously said, I want to embed 50 one minute flash videos into a 100 page ebook and send them out over the internet...
    Right now each flash minute is 7MB. Does that mean the embedded videos will total 50 x 7MB? I imagine not but as you can see, I don't have much of an idea about all this but I would sure like to know before I buy Acrobat 9.
    Thanks again in advance,
    Kidd in Paris

  • I purchased an airport Extreme from germany. I would like to know if I can use it in the USA, and would I need anything else apart from a new power cord for the same ?

    I purchased an Airport extreme from Germany to be used as a router. It worked very well over there and I plan to use it in the States. Now, since the power output is different in both USA and Germany, would I only need to buy a new power cord from USA ?

    The AirPort Extreme will run on 100-240 Volts and 50/60 Hz, so it will operate just about anywhere in the world as far as power goes, if you have the right power cord or AC wall adapter. A voltage converter is not needed.
    But, European wireless standards are different than the U.S., so you will need to avoid using Channels 12 and 13, which are not authorized for use in the U.S. Otherwise, things should operate OK.
    For all the details on wireless standards in different parts of the world, see this document:
    http://en.wikipedia.org/wiki/List_of_WLAN_channels

  • Using my Iphone5, i would like to make a full screen picture show on the screen when someone is calling me.  How do I go about that?

    how do I do this?

    With the current version of iOS on an iPhone there is no way to have a full screen contact picture. You can make a suggestion to Apple at http://www.apple.com/feedback/

  • I would like to make my phone to use it for any network?

    I recently purchased a new phone and I like to be able to use it for any network.  At the moment is contract.  But I am sure there is something apple team could help me. 

    Hi there if you could ask the apple team I m sure they would be happy to help.
    But I was in the same situation as you are right at the moment. I was on an optus contract and wanted to use other networks. But in my case I couldn't they couldn't help me and I had to wait for the full two years to be over before I could use a different network.
    You could try to ask the apple team this is just a suggestion.

  • I would like to make a Payment on my account before the due date.

    I have been trying to make a payment on my account, because I am being directed to my account page each time I open Photoshop. Need some help.

    Hi kipling84,
    Let me know the email address on which you have made purchase for Creative Cloud Subscription, I will check it for you.
    Regards
    Srishti A

  • How to write a messenger with using java?

    May I know how to write a messenger with using java? The messenger need included two functions which are file transfer and add users to join the conversation.
    Thank you.

    Ok, so you need to start from the beginning, the requirements, is it a swing (i.e. GUI) app, web app, console, etc...?
    As stated by sprizor making an IM client is no easy task, you need to both implement the server side and the client side, which both communicate with each other, file transfers are also quite complex, and even maintaining a multi-user chat can be quite difficult.
    If you are after a Web Based app, then you will need to look into Push technologies, like Grizzly Comet which is a nice wrapper for the NIO java stuff:
    https://grizzly.dev.java.net/
    Good luck...

  • I already have an Apple ID account with 4 devices connected to it but I would like to make a new one with a desperate password for my school iPad. How do I do that?

    I already have an Apple ID account with 4 devices connected to it but I would like to make a new one with a desperate password for my school iPad. How do I do that?

    You can create a new Apple ID and password for the iPad but none of the content downloaded using the Apple ID associated with the four devices will be available on the iPad.
    Create new >   Apple - My Apple ID
    It's not possible to use two passwords with one Apple ID.

  • I've got a Iphone 3 G with IOS 4.2.1 .I would like to make an Upgrade to IOS 4.3. or better. How can I o it?

    I've got a Iphone 3 G with IOS 4.2.1 .I would like to make an Upgrade to IOS 4.3. or better. How can I do it?

    The 3G was discontinued almost 3 years ago. 4.2.1 is the end of the line for it.

  • Would like to make a SD card with my favorite pics on it to play in a digital photo frame. Is there a way to do this?

    I would like to make an SD card with my favorite pics on it for playing in a digital photo frame. Anybody know how to do this or is it not possible?

    Sure - read teh Digital Frame manual for the specs on how the photos need to to be formatted and then expor tthem to a desktop folder using those paramters and mount the card to the desktop with a card reader and drag the folder to the card
    LN

  • I would like to make a movie of me speaking while doing a power point presentation.  I have seen this done with the powerpoint embedded on the screen and the speaker doing the talking on the rest of the screen.  Is it possible to do this in iMovie?

    I would like to make a movie of me speaking while doing a power point presentation.  I have seen this done with the powerpoint embedded on the screen and the speaker doing the talking on the rest of the screen.  Is it possible to do this in iMovie?

    Scrof wrote:
    ....  Is it possible to do this in iMovie?
    sure.
    the ppt has to be some kind of 'video' iM supports.
    so export it from with MS Office as a Quicktime movie, preffered with 'Animation' codec, or as appleintermediatecodec .. for quality reasons.
    you need the Talking Head as a 2nd video.
    then use iM's Pic-In-Pic feature to combine both videos as wanted.
    I would suggest to do some editing (you full-screen, the ppt full-screen, perhaps 'close ups' of some charts, cut-aways to snoozing audience, etc) to 'pep' the video. for this purpose, it could be much esier to export each slide from within PPT as a jpeg and create the 'flow' in iM only... except, you need the ppt-animations ... but, who uses animations in a presentation anyhow ... ?

  • How is it possible to download Lion on a Macbook Air. I have the answer that "it can't be downloaded on this computer". I bought it with my previous MacBook and I would like to make DVD of it. Thank you.

    How is it possible to download Lion on a Macbook Air. I have the answer that "it can't be downloaded on this computer". I bought it with my previous MacBook and I would like to make DVD of it. Thank you.

    Check that your MBA meets the System Requirements for Lion..
    See Here under General Requirements...
    http://support.apple.com/kb/SP629

Maybe you are looking for

  • How can I add a new column to Grid view under Tests tab

    I understand in "ORACLE Test manager for web Applications", the Grid view under Tests tab should be customised. How can I add a new column to Grid view under Tests tab? Thanks Katherine

  • How to uninstall MacKeeper, once and for all!

    I installed MacKeeper, by accident, like an idiot.  I have followed, what I thought to be everything, to uninstall it for my desktop to no success.  I am so frustrated, whenever i go to a new site it pops up again.  Please help.

  • File Content Conversion - Key Field Value

    Hi Experts, I am using File to Idoc scenario for my mapping. In the receiver Communication channel, I am using File Content Conversion. My scenario is as follows : I have a recordset with Header and Line items with Key Field Indicator as 'H' and 'L'.

  • TC takes longer to re-boot; reports a problem; then fixes itself?

    I had a lot of problems yesterday with my TC. I lost my internet connection and spent 4 hours working on resetting it and the cable modem so they would communicate. During that process, and still today, I am finding a slow internet connection. But, t

  • Which is fast

    Which is fast either stored procedure or stored function in oracle 10g. Thanks in advance