Premium Essay

Cis 247c Ilab 4 of 7: Composition and Class Interfaces

In: Computers and Technology

Submitted By HomeWorkFox
Words 1103
Pages 5
http://goo.gl/Fu6hE
CIS247C
iLab 4 of 6: Composition and Class Interfaces/Abstract Class Click this link to get the tutorial

http://goo.gl/Fu6hE | | |

| 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 | |
The objective of the lab is to modify the Employee class to demonstrate composition and a class interface. An employee typically has benefits, so we will make the following changes: 1. Create a Benefits class. 2. Integrate the Benefit class into the Employee class. 3. Create an iEmployee abstract class to guarantee that calculatePay is implemented in the Employee class. A tutorial on interfaces can be downloaded here. 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 Diagram | |

Employee - firstName : string - lastName : string - gender : char - dependents : int - annualSalary : double - static numEmployees : int = 0 +benefit : Benefit +Employee() +Employee(in fname : String, in lname : String, in gen : char, in dep : int, in sal : double) +calculatePay() : double +displayEmployee() : void +static getNumEmployees() : int +getFirstName() : string +setFirstName(in name : String) : void +getLastName() : String +setLastName(in name : String) : void +getGender() : char +setGender(in gen : char) : void +getDependents() : int +setDependents(in dep : int) : void +getAnnualSalary() :

Similar Documents

Premium Essay

Cis 247c Ilab 4 of 7: Composition and Class Interfaces

...http://goo.gl/Fu6hE CIS247C iLab 4 of 6: Composition and Class Interfaces/Abstract Class Click this link to get the tutorial http://goo.gl/Fu6hE | | | | 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 | | The objective of the lab is to modify the Employee class to demonstrate composition and a class interface. An employee typically has benefits, so we will make the following changes: 1. Create a Benefits class. 2. Integrate the Benefit class into the Employee class. 3. Create an iEmployee abstract class to guarantee that calculatePay is implemented in the Employee class. A tutorial on interfaces can be downloaded here. 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 Diagram | | Employee - firstName : string - lastName : string - gender : char - dependents : int - annualSalary : double - static numEmployees : int = 0 +benefit : Benefit +Employee() +Employee(in fname : String, in lname : String...

Words: 1103 - Pages: 5

Free Essay

Cis247C Week 5: Composition, Inheritance, and Polymorphism

...gl/wUFyk CIS 247C Week 5 Lab DeVry University Click on this Link to get the Tutorial http://goo.gl/wUFyk Week 5: Composition, Inheritance, and Polymorphism - iLab i L A B O V E R V I E W Scenario and Summary The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes: 1. Create a class called Salaried that is derived from Employee. 2. Create a class called Hourly that is also derived from Employee. 3. Override the base class calculatePay() method. 4. Override the displayEmployee() method. i L A B S T E P S STEP 1: Understand the UML Diagram Notice the change in UML diagram. It is common practice to leave out the accessors and mutators (getters and setters) from UML class diagrams, since there can be so many of them. Unless otherwise specified, it is assumed that there is an accessor (getter) and a mutator (setter) for every class attribute. STEP 3: Modify the Employee Class 1. Using the updated Employee class diagram, modify the attributes to be protected. 2. Delete the iEmployee interface class, and remove the reference from the Employee class. STEP 4: Create the Salaried Class 1. Using the UML Diagrams from Step 1, create the Salaried classes, ensuring to specify that the Salary class inherits from the Employee class. 2. For each of the constructors listed in the Salaried class, ensure to invoke the appropriate base class constructor and...

Words: 667 - Pages: 3