Welcome to Dream.In.Code
Become a Java Expert!

Join 150,149 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 2,364 people online right now. Registration is fast and FREE... Join Now!




I NEED HELP! Please D:

3 Pages V  1 2 3 >  
Reply to this topicStart new topic

I NEED HELP! Please D:

qwertyness
2 Aug, 2008 - 06:03 PM
Post #1

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 35

I was wondering--I'm going to upload my "Class Notes" book to www.fastfreeupload.com and I was hoping to have someone here download it, look at my assignment and try to help me figure out what I need to do for my last three methods... and I need to do it asap. Anybody willing to do it?
User is offlineProfile CardPM
+Quote Post

KYA
RE: I NEED HELP! Please D:
2 Aug, 2008 - 06:07 PM
Post #2

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,910



Thanked: 159 times
Dream Kudos: 1375
My Contributions
post code here with attempts and lots of people are usually quite happy to assist.
User is offlineProfile CardPM
+Quote Post

qwertyness
RE: I NEED HELP! Please D:
2 Aug, 2008 - 06:11 PM
Post #3

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 35

QUOTE(KYA @ 2 Aug, 2008 - 07:07 PM) *

post code here with attempts and lots of people are usually quite happy to assist.


I would just like to say.. your avatar is freakin' awesome. http://img396.imageshack.us/my.php?image=s...psmiliesih0.gif biggrin.gif
User is offlineProfile CardPM
+Quote Post

KYA
RE: I NEED HELP! Please D:
2 Aug, 2008 - 06:14 PM
Post #4

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,910



Thanked: 159 times
Dream Kudos: 1375
My Contributions
excellent icon_up.gif
User is offlineProfile CardPM
+Quote Post

qwertyness
RE: I NEED HELP! Please D:
2 Aug, 2008 - 06:20 PM
Post #5

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 35

QUOTE(KYA @ 2 Aug, 2008 - 07:14 PM) *

excellent icon_up.gif


http://fastfreeupload.com/download.php?fil...220%20Notes.pdf Here is the download link for my class notes book (16mb). Um here is the code for the purse thing.
Well, I actually two things I need help with.. you mind? I'll edit my post and post the code if you say so.

This post has been edited by qwertyness: 2 Aug, 2008 - 06:23 PM
User is offlineProfile CardPM
+Quote Post

KYA
RE: I NEED HELP! Please D:
2 Aug, 2008 - 06:33 PM
Post #6

#include <nerd.h>
Group Icon

Joined: 14 Sep, 2007
Posts: 5,910



Thanked: 159 times
Dream Kudos: 1375
My Contributions
That would be better; not too many people want to DL 16mb and sift through it without specific questions in hand.
User is offlineProfile CardPM
+Quote Post

qwertyness
RE: I NEED HELP! Please D:
2 Aug, 2008 - 06:46 PM
Post #7

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 35

I'm gonna double post, hope you don't mind =D1. Define Payroll class instance fields (4 points)

a. The field employeeId represents an array of seven integers to hold employee identification numbers. It id initialized with the following numbers:
5658845 4520125 7895122 8777541 1302850 7580489

b. The filed hours represents an array of seven integers to hold the number of hours worked by each employee.

c. The field payRate represents an array of seven doubles to hold each employee’s gross pay.

d. The field wages represents an array of seven doubles to hold each employee’s gross wages.

2. Define PayrollDefault constructor (5 points)

a. Default constructor ( having no arguments)

i. Create an abject of the class Payroll having an employeeId array initialized with the employee id numbers, as well as arrays of hours, payRate and wages, all created to the same size as the employeeId array.

3. Methods: (24 points)

a. Define accessor method getEmployeeId

i. if the index parameter is between 0 and one less than the array length, return the employeeId stored at that index. If the index parameter is not valid, return -1.

b. Define accessor method getHours

i. if the index parameter is between 0 and one less than the array length, return the hours worked for the employee that corresponds to the parameter index. If the index parameter is not valid, return -1.

c. Define accessor method getPayRate

i. if the index parameter is between 0 and one less than the array length, return the pay rate for the employee that corresponds to the parameter index. If the index parameter is not valid, return -1.

d. Define accessor method getWages

i. if the index parameter is between 0 and one less than the array length, return the gross pay for the employee that corresponds to the parameter index. If the index parameter is not valid, return -1.

e. Define mutator method setHours

i. if the number of hours is non-negative and the index is between 0 and one less than the length of the array, set the number of hours for the employee, that corresponds to the parameter index, to the parameter number of hours.

f. Define mutator method setPayRate

i. if the pay rate is greater than or equal to 6.00 and the index is between 0 and one less than the length of the array, set the pay rate for the employee, that corresponds to the parameter index, to the parameter pay rate.

g. Define mutator method setWages

i. if the index is between 0 and one less than the length of the array, calculate the wages, including any overtime pay, and set the wages for the employee, that corresponds to the parameter index, to the wages.

h. Define mutator method searchForPay

i. Return the gross pay for the employee that corresponds to the parameter employee identification number.

Create a tester to class called RunPayroll Class to test the Payroll class.

1. Create an object of class Payroll and declare local variables. (1 point)

2. For each employee:

a. Display employee number (0.5 points)

b. Ask user to enter the number of the hours worked (0.5 points)

c. Read in hoursWorked, validate, and set the hours for that employee (0.5 points)

d. Ask user to enter the hourly pay rate (0.5 points)

e. Read in rate, validate, and set the pay rate for that employee (0.5 points)

f. Set the wages for that employee. (0.5 points)

3. Get each employee number and use it to search for that employee’s wages. (1 point)





This is the first thing I have to do. Is there a way we could chat live on like.. aim or mIRC or something? I'd prefer that if you would, too.
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: I NEED HELP! Please D:
2 Aug, 2008 - 06:54 PM
Post #8

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,166



Thanked: 78 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(qwertyness @ 2 Aug, 2008 - 10:46 PM) *

This is the first thing I have to do.


... do you have a specific question, or are you just looking to have someone do your project for you?
User is online!Profile CardPM
+Quote Post

qwertyness
RE: I NEED HELP! Please D:
2 Aug, 2008 - 07:03 PM
Post #9

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 35

QUOTE(no2pencil @ 2 Aug, 2008 - 07:54 PM) *

QUOTE(qwertyness @ 2 Aug, 2008 - 10:46 PM) *

This is the first thing I have to do.


... do you have a specific question, or are you just looking to have someone do your project for you?


No no no no I do NOT want anyone to do it for me. (If I have them do it, I won't learn anything and I can't do the next one ;P) I would like a hint or some basic understanding, that's why I'd like for someone to look at the assignment.. or to ask them live. It's faster.
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: I NEED HELP! Please D:
2 Aug, 2008 - 07:08 PM
Post #10

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 7,166



Thanked: 78 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(qwertyness @ 2 Aug, 2008 - 11:03 PM) *

I would like a hint or some basic understanding

A hint or basic understanding of what? You have not asked any questions, you've only posted your project assignment.

What do you need help with?

I'm not trying to be difficult, but if you just post "I NEED HELP" & then show the assignment, you will not get help here. Your request will get overlooked as no one likes to play 20 questions with what the problem is.

However, if you post your code, & what problems you are having, then someone (even a few people, as Java is a particularly popular forum here) will gladly go into in-depth detail to help you understand where your problem area(s) exist.

It's sort of like calling up the mechanic & saying "My car is making a clunk noise, what could it be?". They won't even try to ask, they'll just tell you to bring it in.
User is online!Profile CardPM
+Quote Post

qwertyness
RE: I NEED HELP! Please D:
2 Aug, 2008 - 07:12 PM
Post #11

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 35

QUOTE(no2pencil @ 2 Aug, 2008 - 08:08 PM) *

QUOTE(qwertyness @ 2 Aug, 2008 - 11:03 PM) *

I would like a hint or some basic understanding

A hint or basic understanding of what? You have not asked any questions, you've only posted your project assignment.

What do you need help with?

I'm not trying to be difficult, but if you just post "I NEED HELP" & then show the assignment, you will not get help here. Your request will get overlooked as no one likes to play 20 questions with what the problem is.

However, if you post your code, & what problems you are having, then someone (even a few people, as Java is a particularly popular forum here) will gladly go into in-depth detail to help you understand where your problem area(s) exist.



Here is some code for my first class.
CODE
public class Purse
{
    //max possible # of coins in a purse
    private static final int MAX = 10;
    
    private int contents[];
    public int count; //count # of coins stored in contents[]
    
    public Purse()
    {
        contents = new int[MAX];
        count = 0;
    }
    
    public void addCoin(int coinType)
    {
        if(count < 10 && coinType >= 1)
        {
            contents[count] = coinType;
            count++;
        }
    }
    
    
    public String toString()
    {
        return contents[0] + "," + contents[1] + "," +contents[2] + "," + contents[3] + "," + contents[4] + ","
        + contents[5] + "," + contents[6] + "," + contents[7] + "," + contents[8] + "," + "," +contents[9];
    }
    
    public int value()
    {
         int sum = 0;
          for(int i=0; i<= 4; i++)
             sum = sum + contents[i];
          return sum;
    }
    
    public void reverse()
    {
          int left  = 0;          // index of leftmost element
           int right = contents.length-1; // index of rightmost element
          
           while (left < right)
           {
              // exchange the left and right elements
              int temp = contents[left];
              contents[left]  = contents[right];
              contents[right] = temp;
            
              // move the bounds toward the center
              left++;
              right--;
           }
    }
        
    
    public void transfer(Purse donor)
    {        
    
    }
    
    public boolean sameCoinsSameOrder(Purse other)
    {
        
    }
    //SEXTRA CREDIT METHODS
    
    public void printCoinPairs(Purse other)
    {
        
    }
}


I need help with the last three methods. When someone posts back I'll describe what they're supposed to do.


User is offlineProfile CardPM
+Quote Post

qwertyness
RE: I NEED HELP! Please D:
2 Aug, 2008 - 07:38 PM
Post #12

New D.I.C Head
*

Joined: 2 Aug, 2008
Posts: 35

Well.. no one is posting so I'll describe the methods.

Transfer is basically just that: the method is described "transfers the contents of one purse (the donor purse) to the end of another, the receiver. (The receiver will be the Purse object calling the method (i.e. the invoking object)). Leaves the donor purse empty."


if the receiver is Purse[5, 10, 25, 25] and the donor is Purse[5, 5, 10, 1, 25, 5] then after the transfer receiver is Purse[5, 10, 25, 25, 5, 5, 10, 1, 25, 5] and the donor is Purse[] you can call the addCoin() method to set a purse to empty, simply set its count to 0

sameCoinsSameOrder(Purse other): returns whether two purses have the coins in exactly the same order.


printCoinPairs(Purse other): compare two purses. Prints each pair of coins, as demonstrated below
if p1 is Purse[5,1, 25, 25, 5] and p2 is PUrse[25, 10, 5, 5, 5, 10] then p1.printCoinPairs(p2) would output to the Terminal Window: 5 25 5



Those are the methods I need. I don't know how to do Transfer with arrays and I have NO clue how to do the last two.

This post has been edited by qwertyness: 2 Aug, 2008 - 07:42 PM
User is offlineProfile CardPM
+Quote Post

3 Pages V  1 2 3 >
Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 02:32AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month