Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 10th, 2008, 10:19 AM   #1
bearvsgodzila
Newbie
 
Join Date: Jan 2008
Posts: 4
Rep Power: 0 bearvsgodzila is on a distinguished road
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
Attached Files
File Type: doc OOP Tutorial question.doc (39.0 KB, 2 views)
bearvsgodzila is offline   Reply With Quote
Old Jan 10th, 2008, 4:04 PM   #2
null_ptr0
11 years old
 
Join Date: Nov 2007
Posts: 79
Rep Power: 1 null_ptr0 is on a distinguished road
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
null_ptr0 is offline   Reply With Quote
Old Jan 11th, 2008, 8:53 AM   #3
bearvsgodzila
Newbie
 
Join Date: Jan 2008
Posts: 4
Rep Power: 0 bearvsgodzila is on a distinguished road
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
bearvsgodzila is offline   Reply With Quote
Old Jan 18th, 2008, 6:53 AM   #4
domquem
Newbie
 
Join Date: Jun 2005
Posts: 7
Rep Power: 0 domquem is on a distinguished road
Send a message via Yahoo to domquem
Re: Need array help, desperately !!

can u help a brother out! geeeezzzz!
domquem is offline   Reply With Quote
Old Jan 18th, 2008, 3:31 PM   #5
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,192
Rep Power: 5 grumpy is on a distinguished road
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.
grumpy is offline   Reply With Quote
Old Jan 18th, 2008, 3:45 PM   #6
mbd
Programmer
 
Join Date: Nov 2007
Posts: 86
Rep Power: 1 mbd is on a distinguished road
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.
mbd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:10 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC