Total Confusion..plzz help me guyz

Hi, this is first post in this forum and i must admit that I'm not good in java only moderate however for my assignment, the lecture gave me a question which is difficult for me..here's the question

1.Create a class EmployeeMedical with employee id, name, jobcode, and collection of claims. Create(may be - an inner) class Claims having date, clinic, doctor and amount of claim. if claims exhausted a no more claims are admitted.

2. Create class MedicalLimit having jobcode and limit

3. Create a class Office containing Employee Medical accounts with add, search, sort and delete methods.

a) Search any employee and use the claim submitted amount deducted from limits, whenever a claim is submitted

b) display list of claims submitted already for an officer

c) display both jobcode wise with claims in ascending order

d) Display details of unclaimed amount of details in ascending order of jobcode

My lecturer said we can use Vector, Stack n queue in this program. so, plss me. This is important for me guyz. Any help would be appreciated and i will be grateful for those who help. Thanks

[1145 byte] By [tarun_rahula] at [2007-11-27 11:19:58]
# 1

> My lecturer said we can use Vector, Stack n queue in

> this program. so, plss me. This is important for me

> guyz. Any help would be appreciated and i will be

> grateful for those who help. Thanks

You need to ask yourself this "Do I really want to be a programmer?" If the answer is yes then get on with it.

They have already told you which classes to create and what fields and methods these will have, all you have to do is type it out.

Show some effort and you might get some help but you have no chance with your current approach.

_helloWorld_a at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 2

> ...

> My lecturer said we can use Vector, Stack n queue in

> this program. so, plss me. This is important for me

> guyz. Any help would be appreciated and i will be

> grateful for those who help. Thanks

Help with what? What don't you understand? Surely you must have made a start?

Please ask a specific question about code you're having trouble with. When posting (your own) code, please use code-tags:

http://forum.java.sun.com/help.jspa?sec=formatting

prometheuzza at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 3

Also when you post, make your thread title have something to do with the problem your having. Some people just scan through looking for stuff that they are able to answer, and skip over forum titles such as "URGENT, PLEASE HELP" or "I don gett it.." etc.

Perhaps you should take a crack at doing it yourself, and then if you still can't get it, post what you have done (shows us that your not some lazy bum getting others to do you work for you) and we can tell you what you need to fix, whats good, what needs to be added, etc.

Futurisdom_Developera at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 4

Welcome tarun_rahul ..

i might be new to this forum, but not new to java, this is my fourth year with it,,

i have to tell you that you won't feel the joy of programming without focusing for days and nights even on a few lines ..

so get it a little by your self, and if any problem was on the way, i'm sure that me and the guys won't be mean with any help..

waiting your code post;

thx (^_^);

QussayNajjara at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 5

sorry guys.dun mistaken me coz i'm not lazy..currently working on it. just i need for some time and thanks for encouraging me

tarun_rahula at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 6

> thanks for encouraging me

you welcome ...(^_~);

QussayNajjara at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 7

EmployeeMedical kinda writes itself. Can you at least write that and post it?

%

duffymoa at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 8

> Hi, this is first post in this forum

Not a good start.

> and i must admit that I'm not good in java

We can see that.

> only moderate

That's questionable.

> however for

> my assignment, the lecture gave me a question which

> is difficult for me..here's the question

>

> 1.Create a class EmployeeMedical with employee id,

> name, jobcode, and collection of claims. Create(may

> be - an inner) class Claims having date, clinic,

> doctor and amount of claim. if claims exhausted a no

> more claims are admitted.

>

> 2. Create class MedicalLimit having jobcode and

> limit

>

> 3. Create a class Office containing Employee Medical

> accounts with add, search, sort and delete methods.

> a) Search any employee and use the claim submitted

> amount deducted from limits, whenever a claim is

> submitted

> b) display list of claims submitted already for an

> officer

> c) display both jobcode wise with claims in ascending

> order

> d) Display details of unclaimed amount of details in

> ascending order of jobcode

I see four classes here, all pretty well described. You can't write four classes?

> My lecturer said we can use Vector, Stack n queue in

> this program.

Do you know what those classes are? Have you looked at the java.util package?

> This is important for me guyz.

But not for us.

> Any help would be appreciated and i will be

> grateful for those who help. Thanks

If you're asking people to write code for you, you're in the wrong place. (Unless that eejit fastmike sees this post.)

The way it works is this: You write something and post questions when they come up.

Please do post your professor's email address so we can let him/her know that you're trying to cheat here. That should sort things out.

%

duffymoa at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 9

to duffymo,

look man, first of all, i was desperate coz i was takin 5 subjects and i kinda stressed but thanks for some good guys in this forum who encouraged me, i'm doin the problem and somehow managed to solve certain things.

If u think i'm cheatin then i think ur mistaken and from this i noe ur some sort of a java expert programmer. If u dun like, pls dun reply to this post and hurt my feelings coz not all guys can be as good as u

tarun_rahula at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 10

@tarun_rahul, please take the time to read these:

http://www.catb.org/~esr/faqs/smart-questions.html#writewell

http://www.catb.org/~esr/faqs/smart-questions.html#not_losing

prometheuzza at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 11

Hi guyz, this is the coding i hv done for three classes which is the EmployeeMedical, MedicalLimit and Claims. Here's the code:

import java.io.*;

public class EmployeeMedical implements Serializable

{

private String emID, emName;

private MedicalLimit jobC;

private double total_claims;

public StackArray claims, temp;

public EmployeeMedical()

{

setEmployeeMedical(null, null, null , 0.00, null);

}

public EmployeeMedical(String id, String name, MedicalLimit job, double claim, StackArray cla)

{

setEmployeeMedical(id, name, job, claim, cla);

}

private void setEmployeeMedical(String id ,String name, MedicalLimit job, double claim, StackArray cla)

{

emID = id;

emName = name;

jobC = job;

total_claims = claim;

claims = cla;

}

public String getID() {return emID;}

public String getName() {return emName;}

public MedicalLimit getJobC() {return jobC;}

public double getClaim() {return total_claims;}

public StackArray getCla() {return claims;}

public String getClaimsTotal()

{

temp = new StackArray();

String output = "";

while(!claims.isEmpty()){

output +=claims.peek() + "\n";

temp.push(claims.pop());

}

while(!temp.isEmpty()) {

claims.push(temp.pop());

}

return output + "\n";

}

public String toString()

{

return emID + "\t" + emName + "\t" + getjobC() + "\t" + total_claims + "\t";

}

}

public class Claims

{

private Date date_of_claims;

private String clinic, doctor;

private double claim_total;

public Claims(){ setClaims(null, null, null, 0.00);}

public Claims(Date date, String cli, String doc, double claim){setClaims(date, cli, doc, claim);}

private void setClaims(Date date, String cli, String doc, double claim)

{

date_of_claims = date;

clinic = cli;

doctor = doc;

claim_total = claim;

}

public Date getDate() { return date_of_claims;}

public String getClinic() {return clinic;}

public String getDoc() {return doctor;}

public double getClaim() {return claim_total;}

public String toString()

{

return date_of_claims + "\t" + clinic + "\t" + doctor + "\t" + claim_total;

}

}

import static javax.swing.JOptionPane.*;

public class MedicalLimit

{

private String jobcodes[]= {"1-Doctor\n","2-Head Nurse\n","3-Senior Nurses\n","4-Reception Manager\n","5-Receptionist\n"};

private int job;

private double limit;

public MedicalLimit(){ setMedicalLimit(0); }

public MedicalLimit(int jo){setMedicalLimit(jo);}

private void setMedicalLimit(int jo)

{

job = jo;

}

public int getJob() {return job;}

public String getJobC() {return jobcodes[getJob()];}

public String findLimit()

{

int job = Integer.parseInt(showInputDialog("Please select your jobcode:" + getJobC()));

if(job == 1){

limit = 3000;

}

else if(job == 2){

limit = 1800;

}

else if(job == 3){

limit = 1400;

}

else if(job == 4){

limit= 1500;

}

else if(job== 5) {

limit = 1200;

}

return getJobC() + "\t" + limit;

}

public String toString()

{

return findLimit();

}

}

Actually, in the MedicalLimit class, it's required i enter a fixed value of amount of claim(limit) for each jobcode so that when an employee withdraws a particular amount(amount A), the particular amount will be subtracted from the limit(limit - amount A) and displays the remaining amount(new value for limit) in which the employee can withdraw:

For example, if the limit is 2000 and the employee is withdrawing 500, then the remainig amount is 1500 and new limit value should be updated for that particualr employee only. For the other employess with the same jobcode, the limit should be 2000.

I dunno how to explain, i hope u guyz can understand what I'm saying. So, can u guyz give some suggestions?

tarun_rahula at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 12

> I dunno how to explain, i hope u guyz can understand

> what I'm saying. So, can u guyz give some

> suggestions?

See bottom of reply two.

_helloWorld_a at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 13

> Hi guyz, this is the coding i hv done for three

> classes which is the EmployeeMedical, MedicalLimit

> and Claims. Here's the code:

Does it compile? If not, what errors are you seeing?

Also, what is a "StackArray"? Where did you find this class and where is the api for it?

Message was edited by:

petes1234

petes1234a at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 14

> > Hi guyz, this is the coding i hv done for three

> > classes which is the EmployeeMedical,

> MedicalLimit

> > and Claims. Here's the code:

>

> Does it compile?

No.

> If not, what errors are you

> seeing?

Too many to summarize here.

> Also, what is a "StackArray"? Where did you find

> this class and where is the api for it?

java.util.Stack is my guess.

%

duffymoa at 2007-7-29 14:39:47 > top of Java-index,Java Essentials,Java Programming...
# 15

good work so tarun_rahul ... tell me do you have any errors during compiling or logical errors...ready to help...

QussayNajjara at 2007-7-29 14:39:52 > top of Java-index,Java Essentials,Java Programming...