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 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?
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
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.
... 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.
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.
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; }
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