![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jan 2008
Posts: 4
Rep Power: 0
![]() |
Need array help, desperately !!
Hey there, currently i have a 1 week home/quiz some like that i quite lost on array which focuses on java OOP.
The program consist of 3 classes and 1 application to run it. There are : Applicant , job and Agency class i just finish doing 2 classes which is Applicant and Job class Just the agency i not very sure how to do it. i will show below the two classes public class Applicant{
//attributes
private String name;
private String nric;
private String qualification;
private String field;
private boolean available;
//constructor
public Applicant(String name, String nric, String qualification, String field, boolean available)
{
this.name = name;
this.nric = nric;
this.qualification= qualification;
this.available= available;
}
//methods
public String getName(){
return name;
}
public void setAvailable(boolean a){
available=a;
}
public String getNric(){
return nric;
}
public String getQualification(){
return qualification;
}
public String getfield(){
return field;
}
public String toString()
{
String info="name: "+name+"\nnric: "+nric+"\nqualification:"+qualification+"/nfield:"+field;
return info;
}
}Job Class public class job{
private String job;
private String title;
private String company;
private int numofVacancy;
private String field;
private String qualification;
private String id;
public job(String id,String job,String title,String company,int numofVacancy, String field,String qualification)
{
this.job=job;
this.title=title;
this.company=company;
this.numofVacancy= numofVacancy;
this.qualification= qualification;
this.field=field;
this.id=id;
}
public int computeCommission()
{
int commission = 0;
if( qualification== "A level")
{
commission = 300;
}
else
{
if(qualification == "diploma")
{
commission = 400;
}
else
{
if(qualification == "degree or higher")
{
commission = 500;
}
}
}
return commission;
}
public String getId()
{
return id;
}
public String getJob()
{
return job;
}
public String getTitle()
{
return title;
}
public String getCompany()
{
return company;
}
public int getNumofVacancy()
{
return numofVacancy;
}
public String getField()
{
return field;
}
public String getQualification()
{
return qualification;
}
public String toString()
{
String info = "job:"+job+"\ntitle:"+title+"\ncompany:"+company+"\nnumber of vacancy:"+numofVacancy+"\nfield:"+field+"\nqualification"+qualification;
return info;
}
}Gee can some1 who good at array kindly help me with sample code to let me understand how to check on duplicate applicant, return null, add and remove array. PLease help a newbie in java. For you guys want to know what the program wants i have put the question in document 2003 for better understanding (attachment file below) Thanks in Advance ![]() |
|
|
|
|
|
#2 |
|
11 years old
Join Date: Nov 2007
Posts: 79
Rep Power: 1
![]() |
Re: Need array help, desperately !!
If I understood anything of what you said, I might have answered. Try to not talk in broken English.
__________________
iload_0 iconst_1 ishl or iload_0 iconst_2 idiv or iload_0 iconst_2 iconst_1 imul idiv [1] & [2] use the smallest stack size |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jan 2008
Posts: 4
Rep Power: 0
![]() |
Re: Need array help, desperately !!
I'm very sorry about the broken english, but i put the document in the attachment for further understanding, if in the thread you don't understand what i'm talking about .
No offence ![]() |
|
|
|
|
|
#4 |
|
Newbie
|
Re: Need array help, desperately !!
can u help a brother out! geeeezzzz!
|
|
|
|
|
|
#5 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,192
Rep Power: 5
![]() |
Re: Need array help, desperately !!
Actually, domquem, we can't.
If you read the site rules, doing homework is against site rules. The attached document is homework, and he is asking us to adding parts of the solution that he has not done himself. His question is also as clear as mud as well. Even if it wasn't homework, it is necessary to ask a clear question in order to get a clear answer. |
|
|
|
|
|
#6 |
|
Programmer
Join Date: Nov 2007
Posts: 86
Rep Power: 1
![]() |
Re: Need array help, desperately !!
There is a class called ArrayList. The methods you are looking for are named:
1. contains - tell if applicant exists in the list 2. add - add an applicant to the list 3. remove - remove an applicant from the list Please read that documentation and attempt to solve this on your own. The documentation is available in some languages other than english. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| dynamic array help | quickster12 | C++ | 4 | Nov 29th, 2007 11:52 PM |
| problem processing file into a char array | csrocker101 | C++ | 1 | May 8th, 2007 11:50 PM |
| changing size of an array | Eric the Red | Java | 3 | Apr 3rd, 2006 8:19 PM |
| Installing IPB 2.03 | bh4575 | Other Web Development Languages | 0 | Apr 23rd, 2005 2:36 AM |
| Converting 1-dimensional array to 2-dimensional array | Tazz_Mission_13 | Java | 6 | Apr 8th, 2005 11:58 AM |