Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 398 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 15 Sep 2017 My Price 9.00

Employee data

Write a JAVA program to enter Employee data, including social security number and salary, into an array. (The maximum number of employees is 100, but your program should also work for any number of employees less than 100.) Your program should use two exception classes called SSNLengthException for when the social security number entered (SSN) is not exactly nine characters and SSNCharacterException for when any character in the social security number is not a digit. (The SSN is to be entered with just the numbers and no dashes or spaces.) When an exception is thrown, the user is reminded of what she or he entered, told why it is inappropriate, and asked to reenter the data. After all data has been entered, your program will output the records for all employees, with an annotation stating whether the employeeA????1s salary is above or below average. You will also need to define the classes Employee, SSNLengthException, and SSNCharacterException. The class Employee will be a derived class of the class Person available on the K: drive. Among other things, the class Employee should have input and output methods, as well as constructors, accessor methods, and mutator methods. Every employee object will record the employeeA????1s name, salary, and social security number (plus any other data you need or think are appropriate).

This is what I have so far:

public class Person

{
private String name;
  
public Person()
{
name = "No name yet";
}
  
public Person(String initialName)
{
name = initialName;
}
  
public void setName(String newName)
{
name = newName;
}
  
public String getName()
{
return name;
}
  
public void writeOutput()
{
System.out.println("Name: " + name);
}
  
public boolean hasSameName(Person otherPerson)
{
return this.name.equalsIgnoreCase(otherPerson.name);
}
}

public class Employee
{
private String firstName;
private String lastName;
private String socialSecurityNumber;

// constructor
public Employee(String first, String last, String ssn)
{
firstName = first;
lastName = last;
socialSecurityNumber = ssn;
}

// set first name
public void setFirstName(String first)
{
firstName = first;
}

// return first name
public String getFirstName()
{
return firstName;
}

// set last name
public void setLastName(String last)
{
lastName = last;
}

// return last name
public String getLastName()
{
return lastName;
}
  
//set social security number
public void setSocialSecurityNumber(String number)
{
socialSecurityNumber = number; // should validate
}

// return social security number
public String getSocialSecurityNumber()
{
return socialSecurityNumber;
}

// return String representation of Employee object
public String toString()
{
return getFirstName() + " " + getLastName() +
"\nsocial security number: " + getSocialSecurityNumber();
}
} // end class Employee


public class SSNCharacterException extends Exception
{
public SSNCharacterException()
{
super("Inappropriate Character in SSN:Non Digit Character Found");
}

public SSNCharacterException(String msg)
{
super(msg);
}
}

Answers

(5)
Status NEW Posted 15 Sep 2017 02:09 PM My Price 9.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)