agony_aunt No wonder she threw you out! Your code is politically incorrect! Let me tell you why. Here's a piece of your code:
class Employee
{
Gender gender;
String name;
public Employee(String name, Gender gender)
{
this.name = name;
this.gender = gender;
}
...
}
...
Employee employee = new Employee("Ramya", Gender.Female);
Do you see what you did wrong there? You objectified women! You are such a sexist pig! Women should never be represented by objects. You should do this intead:
int calculateSalary(String name)
{
if(isMale(name))
{
Employee man = getEmployeeByName(name);
return man.getSalary();
}
else
{
//be careful not to create an object, not even a structure.
return getSalaryForFemalePerson(name);
}
}
The second mistake you did was here:
class Employee
{
...
int getAge()
{
return age;
}
...
}
You can't ask a woman her age! Thats rude, and in some countries, it's illegal! This is what you should do:
int getAge(String name)
{
if(isMale(name))
{
Employee man = getEmployeeByName(name);
return man.getAge();
}
else
{
throw new SexistException("Male Chauvinist Pig!");
}
}
Your comparison function is also totally wrong. What it should be doing is:
int compareEmployees(String emp1, String emp2)
{
if(isMale(emp1) && isFemale(emp2))
return -1;//men are inferior to women.
if(isFemale(emp1) && isMale(emp2))
return +1;//women are superior to men.
if(isFemale(emp1) && isFemale(emp2))
//woman with more jewelry wins.
return getJewelry(emp1) - getJewelry(emp2);
return 0;//all men are equally stupid.
}
Even though it is a payroll application, you always need to implement these functions:
boolean isFat(String name)
{
if(isMale(name))
{
Employee man = getEmployeeByName(name);
return man.getWeight() > AVERAGE_WEIGHT;
}
else
{
return false;
}
}

6 comments:
ahhhaa, saar its geeky enough to figure out in 'The Big Bang Theory' !
sakkath funny!
小遊戲,ut男同志聊天室,成人圖片區,交友104相親網,0951成人頻道下載,男同志聊天室,成人貼圖,成人影片,tt1069同志交友網,成人視訊,aio交友愛情館,情色視訊,情色視訊,色情遊戲,交友戀愛小站,jp成人,熊貓貼圖,成人圖片,成人文章,正妹,成人小說,杜蕾斯成人,ut 聊天室,熊貓貼圖區,交友聊天找e爵,ol制服美女影片,777成人區,bt成人,女同志聊天室,貼圖片區,一葉情貼圖片區,6k聊天室,69成人,成人貼圖站,色情影片,聊天室ut,免費成人影片,成人漫畫,0204貼圖區,小高聊天室,歐美免費影片,
@Anon: nimmajji pinDa
Thanks for the informative information - I enjoyed reading it! I always enjoy this blog. :) Cheers, www.video-of-human-birth.com
Thanks for the informative information - I enjoyed reading it! I always enjoy this blog. :) Cheers, video of human birth
You should not even be referring to it as "female" thats totally sexist.
So the more politically correct terms are male and non-male [:)]
Post a Comment