Discount Get CIS 247B ALL WEEKS Solution ONLY $84.70 $112.93
CIS 247B Week 1 - in Java [$8.99]
CIS 247B Week 2 - in Java – Object Construction and Data Abstra... [$15.99]
CIS 247B Week 3 - in Java - Overloaded Methods and Static Methods... [$15.99]
CIS 247B Week 4 - in Java - Composition and Class Interfaces [$15.99]
CIS 247B Week 5 - in Java - Composition, Inheritance, and Polymor... [$15.99]
CIS 247B Week 6 - in Java - Interfaces and Abstract Classes [$19.99]
CIS 247B Week 7 - in Java - Putting It All Together [$19.99]
Get Selected Weeks Solution with ONLY NOT Add Selected Tutorials To Cart
CIS247 CIS 247 CIS/247 - CIS247B -  Week 2 - Lab 2 - iLab 2 - in Java – Object Construction and Data Abstraction – Guaranteed 100% score
    CIS247 CIS 247 CIS/247 - CIS247B -  Week 2 - Lab 2 - iLab 2 - in Java – Object Construction and Data Abstraction – Guaranteed 100% score

CIS247 CIS 247 CIS/247 - CIS247B - Week 2 - Lab 2 - iLab 2 - in Java – Object Construction and Data Abstraction – Guaranteed 100% score

$15.99

Week 2: Object Construction and Data Abstraction – iLab

iLab 2 of 7: Employee Class

Connect to the iLab here.

Submit your assignment to the Dropbox located on the silver tab at the top of this page.
(See Syllabus “Due Dates for Assignments & Exams” for due dates.)

i L A B O V E R V I E W

Scenario and Summary
We begin our investigation of object-oriented programming by creating an object-oriented program with a class called Employee. You will create two objects based on the Employee class, along with a class that contains the main method. The attributes, constructors, and methods for this class must satisfy the requirements in Steps 1 through 3. After you create the objects, you will prompt the user for information and then display it.
We will want to ensure that this first class is well-constructed and tested since we will extend this class in Labs 3 through 6.
Deliverables
Due this week:

  • Capture the Console output window and paste it into a Word document.
  • Zip the project folder files.
  • Put the zip file and screen shots (Word document that contains programming code and screen shots of program output) in the Dropbox.

i L A B S T E P S

STEP 1: Understand the UML Class Diagram
Use the following UML diagram to build the class. The first section specifies the attributes. The second section specifies the behaviors, and the first character specifies the access modifier value, where:

  • “-” means that the class member is private, and
  • “+” means that the class member is public.

Employee

- firstName : string

- lastName : string

- gender : char

- dependents : int

- annualSalary : double

+Employee()

+Employee(in first : string, in last : string, in gen : char, in dep : int, in salary : double)

+calculatePay() : double

+displayEmployee() : void

+getFirstName() : string

+setFirstName(in first : string)

+getLastName() : string

+setLastName(in last : string)

+getGender() : char

+setGender(in gen : char)

+getDependents() : int

+setDependents(in dep : int)

+getAnnualSalary() : double

+setAnnualSalary(in salary : double)

STEP 2: Code the Employee Class

  1. Create a new project called “CIS247B_WK2_Lab_LASTNAME”.
  2. Using the provided Class Diagram from Step 1, code the Employee class in the new project (i.e., “Realize the UML Class diagrams”).
  3. The default constructor should set the attributes as follows:
    • firstName = “not given”
    • lastName = “not given”
    • gender = “U” (for unknown)
    • dependents = 0
    • annualSalary = 20,000

The multi-arg constructor should initialize all of the attributes using values passed in using its parameter list. As shown in the Class diagram, each attribute should have a “getter” to retrieve the stored attribute value, and a “setter” that modifies the value. The calculatePay( ) method of the Employee class should return the value of annual salary divided by 52 (return annualSalary / 52;). The displayEmployee() method should display all the attributes of the Employee object in a well-formatted string with logical labels applied to each attribute. Don’t forget to call calculatePay from within the displayEmployee method in order to display the Employee’s weekly pay as well! Inside displayEmployee, create a NumberFormat object for currency with the following:

  1. NumberFormat nf = NumberFormat.getCurrencyInstance();
  2. Display the pay with the following:
  3. System.out.println(“Employee Pay: ” + nf.format(pay));

STEP 3: Code the Main Program
In the Main class, create code statements that perform the following operations. Be sure you follow proper commenting and programming styles (header, indentation, line spacing, etc.).

  1. Create an Employee object using the default constructor.
  2. Prompt for and then set the first name, last name, gender, dependents, and annual salary. (Remember that you have to convert gender, dependents, and annual salary from strings to the appropriate data type.)
  3. Using your code from last week, display a divider that contains the string “Employee Information”
  4. Display the Employee information.
  5. Create a second Employee object using the multi-argument constructor, setting each of the attributes with appropriate valid values.
  6. Using your code from last week, display a divider that contains the string “Employee Information”.
  7. Display the Employee information for the second Employee object.

STEP 4: Compile and Test
When done, compile and run your code. Then, debug any errors until your code is error-free.
Check your output to ensure that you have the desired output, modify your code as necessary, and rebuild.
Your output should resemble the following:

Screenshot of a program output that reads:

*************** Employee Information ***************

First Name: John

Last Name: Doe

Gender: M

Dependents: 3

Annual Salary: $46,000.00

Weekly Pay: $884.62

*************** Employee Information ***************

First Name: Sue

Last Name: Smith

Gender: F

Dependents: 3

Annual Salary: $52,000.00

Weekly Pay: $1,000.00

STEP 5: Submit Deliverables

  • Capture the Console output window and paste into a Word document.
  • Put the zip file and screen shots (Word document) in the Dropbox.

Submit your lab to the Dropbox located on the silver tab at the top of this page. For instructions on how to use the Dropbox, read theseStep-by-Step Instructionsor watch thisDropbox Tutorial.
See Syllabus “Due Dates for Assignments & Exams” for due date information.

Solution for CIS247 Week 2 Lab 2 in Java

It is 100% correct solution

How to using solution?

Using any Java IDE (ex Eclipse or Netbean), copy all source codes to src folder, then open and run main class (File Employee.Java).

If you have more questions, please contact me via email support@extutorials.com, i will help you any time

Thank you

Attached Files

Move over [ preview ] file name to preview content in it!

Write a review

Your Name:


Your Review: Note: HTML is not translated!

Rating: Bad           Good

Enter the code in the box below:



PURCHASE SAVE
2 Tutorials 10%
3 Tutorials 13%
4 Tutorials 16%
5 Tutorials 19%
6 Tutorials 22%
7 Tutorials 25%
8 Tutorials 28%
9 Tutorials 31%
10 Tutorials 34%
add url more

9MZQASHWN73B