Daniel Jenkins

Greenhorn
+ Follow
since Jul 12, 2016
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Daniel Jenkins

Can anyone help me put in a counter for the below code so i know how many records there are?
2 years ago
I am done with the assignment. How does it look? any feedback or suggestions ?

2 years ago
how do I add a counter to count the number of employees?
2 years ago
Ok i did what you said but still I have errors on line 16 32,34,35,36,37. do you know how to fix it?


2 years ago

Campbell Ritchie wrote:Just because the whole code has been posted in one pair of code tags doesn't mean it is all in the same file. So I tried it and found lots more errors I hadn't expected.



can you or anyone fix the errors for me and repost the code?? i have no clue how to fix them......i tried
2 years ago
I am working on my assignment which is to create an employee database, the below is what i have so far. and i am getting the following errors: line 54 "firstname can not be resolved to a variable"  line 66,68-71 "employee cannot be resolved to a variable"   line 68 "first name cannot be resolved to a variable   ....  please help..

Any tips in general on the assignment will be greatly appreciated. This is my first coding and it is very hard for me.


here are the assignment instructions
1. An Employee class that contains data about individual employees
a. Fields (all Strings): Last name, first name, department, and job
b. Methods:
i. Set: One “set” method (e.g., setLastName) for each field, which accepts a String object as a parameter and sets the field to the same value as that String
ii. Get: One “get” method (e.g., getLastName) for each field, which returns a String object and leaves the field unchanged
2. An EDA class that maintains records of employees:
a. Fields:
i. an array of Employee objects (initial size set to 100)
ii. a counter (type int) for the current Employee count
b. Methods:
i. Modify: Requires a field name, a match value, and a new value. For any Employee objects whose field matches the match value, the field will be changed to the new value using the appropriate set method
ii. Add (full): Requires four Strings, which will be used to create a new Employee object at the lowest-index unused array entry. Creation will be accomplished via a constructor method. Counter will be incremented.
1. Add (partial 1): Create Employee object using only last name & first name. Department and job will be set to “Unassigned”. Counter will be incremented.
2. Add (partial 2): Create Employee object using only last name, first name, & department. Job will be set to “Unassigned”. Counter will be incremented.
iii. Delete: Requires four Strings, which will be used to identify the correct Employee object. Any Employee objects for which all fields match these four fields will be deleted. The array will be compressed and the counter will be decremented.
iv. Read: Requires a field name and a match value. For any Employee objects whose field matches the match value, the full set of four fields will be displayed on a new line on the console.
c. Inputs:
i. All inputs and output should take place using the Eclipse console
ii. Input format: Words in a multi-word input should be separated by a single space character and be on a single line (i.e., only one Enter keystroke per input)
iii. Inputs should be read using a Scanner object
iv. Inputs should support using a wildcard character “*” as a match value (which will in effect display all Employee records)


2 years ago
The employee class is all good to go as far as i know.. Does anyone know how to add a counter (type int) for the current Employee count,   as stated in the instructions ?
2 years ago
ok is this better?

2 years ago
for Part 2 is this a good start? how do I add "a counter (type int) for the current Employee count" as stated in the instructions

2 years ago
Can you explain to me how to do this ? ^^
2 years ago
I have fixed the code according to all of your suggestions, I am not sure if I did what you guys meant so let me know if I did something wrong. Once I get confirmation that this is correct I will move on to the next steps of the assignment.
2 years ago
Ok here is what i have for part 1 A & B. Is this correct?


2 years ago
Hi,

So, I am a first time programmer and this is literally my first programing assignment ever. I have to create an employee database application using eclipse. See the below instructions. I need some help on how to get started. I know i will be using strings, the scanner class, and arrays.... thats all I know. For now, I need help planning this......how its going to be structured and what classes I should use. Once i have some code started I can post it for feedback and suggestions.


Assignment
Create the initial code for an employee database application.

The required functionality & components are:
1. An Employee class that contains data about individual employees
 a. Fields (all Strings): Last name, first name, department, and job
 b. Methods:
    i. Set: One “set” method (e.g., setLastName) for each field, which accepts a String object as a parameter and sets the field to the same value as that String
    ii. Get: One “get” method (e.g., getLastName) for each field, which returns a String object and leaves the field unchanged
2. An EDA class that maintains records of employees:
  a. Fields:
     i. an array of Employee objects (initial size set to 100)
     ii. a counter (type int) for the current Employee count
  b. Methods:
     i. Modify: Requires a field name, a match value, and a new value. For any Employee objects whose field matches the match value, the field will be changed to the new value using the appropriate set method
    ii. Add (full): Requires four Strings, which will be used to create a new Employee object at the lowest-index unused array entry. Creation will be accomplished via a constructor method. Counter will be incremented.
       1. Add (partial 1): Create Employee object using only last name & first name. Department and job will be set to “Unassigned”. Counter will be incremented.
        2. Add (partial 2): Create Employee object using only last name, first name, & department. Job will be set to “Unassigned”. Counter will be incremented.
    iii. Delete: Requires four Strings, which will be used to identify the correct Employee object. Any Employee objects for which all fields match these four fields will be deleted. The array will be compressed and the counter will be decremented.
    iv. Read: Requires a field name and a match value. For any Employee objects whose field matches the match value, the full set of four fields will be displayed on a new line on the console.
c. Inputs:
    i. All inputs and output should take place using the Eclipse console
    ii. Input format: Words in a multi-word input should be separated by a single space character and be on a single line (i.e., only one Enter keystroke per input)
    iii. Inputs should be read using a Scanner object
    iv. Inputs should support using a wildcard character “*” as a match value (which will in effect display all Employee records)


Program Code Constraints
The program should be written as a single .java file (the Employee class should be included in the EDA.java file, after the EDA class definition). Each of the required functionalities should be implemented as separate methods (as far as possible) and operate by passing parameters and/or returning values. Comments should be provided for the class and for each variable and method, explaining
2 years ago