codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  How to create a data structure that represent a EMPLOYEE???  maroofu at 10:48 on Saturday, May 20, 2006
 

PLz any help in this question i need code of "How to create a data structure that represent a Customer??" that structure will hold variables First Name, Last Name, Salary, Employee ID , Email id , Gender.

PLZZZ help



<Added>

I mean ""How to create a data structure that represent a EMployee??" Not Customer

  Re: How to create a data structure that represent a EMPLOYEE???  crwood at 23:14 on Tuesday, May 23, 2006
 


public class EmployeeTest
{
public static void main(String[] args)
{
Employee john = new Employee("John", "Brown", 211, Employee.MALE,
100.0, "jb@elbow.net");
Employee peggy = new Employee("Peggy Sue", "Fuller", 99);
System.out.println("john = " + john + "\n" +
"peggy = " + peggy);
peggy.setSalary(1000.00);
System.out.println("peggy = " + peggy);
}
}

class Employee
{
String firstName;
String lastName;
int employeeID;
int gender;
double salary;
String emailID;
final static int FEMALE = 0;
final static int MALE = 1;

public Employee(String first, String last, int id, int sex,
double salary, String email)
{
firstName = first;
lastName = last;
employeeID = id;
gender = sex;
this.salary = salary;
emailID = email;
}

public Employee(String first, String last, int id)
{
this(first, last, id, 0, 0.0, "");
}

public void setSalary(double d) { salary = d; }

public String toString()
{
return "name:" + firstName + " " + lastName + ", id:" + employeeID +
", gender:" + (gender == FEMALE ? "female" : "male") +
", salary:" + salary + ", emailID:" + emailID;
}
}









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  File handle problem
•  Link Capture, help needed
•  Re: java app auto web update..
•  IE Only comeback
•  ` Error Code 64: Host not available ` - Error when accessing ASP Appln
•  Re: dynamic crystal report generation
•  Launch an app remotely through a website
•  Run an app in my pc from another pc
•  a:hover elements


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007