The document provides instructions for iLab 4 on composition and class interfaces. Students are asked to:
1. Create a Benefits class and integrate it into the Employee class.
2. Create an iEmployee abstract class to ensure Employee implements calculatePay().
3. Modify Employee to demonstrate composition with Benefits and implement the interface. Students should capture output, zip files, and submit deliverables to the Dropbox.
CIS 247C iLab 4 of 7: Composition and Class Interfaces HomeWork-Fox
CIS 247C Week 4 Lab Devry University
Computer Science - Object-Oriented Programming
iLab 4 of 7: Composition and Class Interfaces
The objective of the lab is to modify the Employee class to demonstrate composition where a containing class (Employee) contains another class (Benefit). An employee typically has benefits, so we will make the following changes:
Create a Benefit class.
Integrate the Benefit class into the Employee class.
Separate the files in the project into Presentation and Logic tier folders
STEP 1: Understand the UML Diagram
The only change to the Employee class is that there is a new attribute:
+benefit : Benefit
Notice that there is a "+" for this attribute, meaning that it is public. Make sure to examine the multi-arg constructor's signature!
Also, the dotted directed line between Employee and iEmployee specifies that the Employee class must implement the iEmployee abstract class, and thus provide an implementation for the calculatePay method.
STEP 2: Create the Project
You will want to use the Week 3 project as the starting point for the lab. To do this, you will want to create a new project by following these steps:
Create a new project and name it "CIS247C_WK4_Lab_LASTNAME".
(Module: Create an artifact at the project level)
At the end of this lab you will be able to:
► Create requirements artifacts at the project level
Given
► The JKE Banking Money That Matters project
Description
► In this lab, you log in as Bob. You continue to populate the project with requirements artifacts.
Exercise tasks
In this exercise, you complete these tasks:
► Task 1: Create a requirement artifact
► Task 2: Create requirements by using the one-click create feature
CIS 247C iLab 4 of 7: Composition and Class Interfaces HomeWork-Fox
CIS 247C Week 4 Lab Devry University
Computer Science - Object-Oriented Programming
iLab 4 of 7: Composition and Class Interfaces
The objective of the lab is to modify the Employee class to demonstrate composition where a containing class (Employee) contains another class (Benefit). An employee typically has benefits, so we will make the following changes:
Create a Benefit class.
Integrate the Benefit class into the Employee class.
Separate the files in the project into Presentation and Logic tier folders
STEP 1: Understand the UML Diagram
The only change to the Employee class is that there is a new attribute:
+benefit : Benefit
Notice that there is a "+" for this attribute, meaning that it is public. Make sure to examine the multi-arg constructor's signature!
Also, the dotted directed line between Employee and iEmployee specifies that the Employee class must implement the iEmployee abstract class, and thus provide an implementation for the calculatePay method.
STEP 2: Create the Project
You will want to use the Week 3 project as the starting point for the lab. To do this, you will want to create a new project by following these steps:
Create a new project and name it "CIS247C_WK4_Lab_LASTNAME".
(Module: Create an artifact at the project level)
At the end of this lab you will be able to:
► Create requirements artifacts at the project level
Given
► The JKE Banking Money That Matters project
Description
► In this lab, you log in as Bob. You continue to populate the project with requirements artifacts.
Exercise tasks
In this exercise, you complete these tasks:
► Task 1: Create a requirement artifact
► Task 2: Create requirements by using the one-click create feature
Assignment Instructions 2_7aExplain the interrelationships bet.docxssuser562afc1
Assignment Instructions 2_7a
Explain the interrelationships between planning, organizing, directing, controlling, and leading.
This is a one-page assignment. Should contain academic references and be thoroughly researched.
Please include an Abstract, Details Heading/Subheading and Conclusion. Also,all include (cites), attach the websites/details/links with the references. I have been asked for them by my professor
Let me know if you any questions.
Please let me know if you any questions.
You will want to use the Week 3 project as the starting point for the lab. To do this, you will want to create a new project by following these steps:
1. Create a new project named "CIS247_WK4_Lab_LASTNAME". An empty project will then be created.
2. Delete the default Program.cs file that is created.
3. Now that we are beginning to add more classes to our projects the
Solution
Explorer can become difficult to organize so you will create folders to hold the Presentation Tier and Logic Tier Files in order to organize the project. One thing to remember, even though we only have a few files in our project, a professional program will have 100's if not 1000's of files in a project so you will want to get practice in organizing your project files in a logical folder heirarchy and we will use the Tiered Architecture structure shown in the UML Class diagram for the folder structure. You will find that creating folders within MS Visual Studio is very similiar to creating folders in Windows Explorer. Follow these directions to create the folders:
1. Select the project and then right click
2. Select Add
3. Select New Folder
4. Enter the name of the folder
4. Add the following three folders to your project (1) Presentation Tier, (2) Logic Tier, and (3) Utilities.
5. You are going to add the files from the previous week lab to the project just as you did before, but now you add the existing files to the corresponding folder
6. Select the PresentationTier folder, right click and select Add then Existing Item, navigate to your previous week's project and select the InputUtitilies.cs and Program.cs files and click add. These two files will then be added to the Presentation. [Hint: you can also drag and drop the files directly from Windows Explorer directly into the corresponding folder in your project!]
7. Add the previous week's Employee.cs file to the Logic Tier folder. You will also add the new Benefits class to this folder.
8. Add the ApplicationUtilities.cs file to the Utilities folder.
9. Your solution explorer should look similiar to the following (note: you can rename any folder by selecting the folder, right click, and then Rename just like you do in Windows).
10. The namespaces for the classes should all be "Employee", but you should verify that the namespaces for all the classes are the same.
11. Update the program information in the ApplicationUtilities.DisplayApplicationInformation method to reflect your name, current lab, and program description.
12 ...
33.docxSTEP 1 Understand the UML Diagram Analyze and under.docxgilbertkpeters11344
3/3.docx
STEP 1: Understand the UML Diagram
Analyze and understand the object UML diagram, which models the structure of the program.
· There are no design changes to the Presentation Tier from the previous project and InputUtilities and ApplicationsUtilities classes are used without modification (except for changing the Application Information).
· The default values for each of the attributres have been declared as a constants, which is indicated by the ALL_CAPS in the name, and the attributes are then set using the default values
· Each of the attributes have been specified as private.
· The accessors (get) and mutators (set) are not shown on the class diagram, but it is ASSUMED that each private attribute has a corresponding property that contains the get and set methods.
· The "static" modifier for the numEmployees attribute means that there is only one copy of the variable that is then shared by all the objects of the class.
· There is a second CalculatePay method that overloads the existing CalculatePay method
· While not shown on the class diagram, the property for numEmployees will only have a get method, which means it will be a "read only" method. (A property with only and set method is a "write-only" property).
Image Description
What is depicted is a single column table with 3 rows. In the first row is the large word "Employee".
In the row beneath this is a list of private parameters, indicated with a "minus" symbol before them (but no space after). These are:
-MIN_DEPENDENTS int =0
-MAX_DEPENDENTS int = 10
-MIN_SALARY double = 20000
MAX_SALARY double = 20000
DEFAULT_NAME string = "Not given"
DEFAULT_GENDER char = 'U'
-firstName : String
-lastName : string
-gender : char
-dependents : int
-annualSalary : double
-static numEmployees: int = 0
In the third and final row beneath this is another list of public parameters, indicated with a "plus" symbol before them (but no space after). These are:
+Employee()
+Employee(in first : string, in last : string, in gen : char, in dep : int, in salary : double)
+ToString : string
+CalculateWeeklyPay() : double
+CalcuateWeeklyPay(modifiedSalary double)
Press the ESC key to close the image description and return to lecture.
STEP 2: Create the Project
You will want to use the Week 2 project as the starting point for the lab. To do this, you will want to create a new project by following these steps:
1. Create a new project named "CIS247_WK3_Lab_LASTNAME". An empty project will then be created.
2. Delete the default Program.cs file that is created.
3. Click on Project->Add Existing Item…. Select the .cs files containing the InputUtilities, ApplicationUtilities, Employee, and Program classes from your project folder from last week's lab.
4. The namespaces for the classes should all be "Employee", but you should verify that the namespaces for all the classes are the same.
5. Update the program information in the ApplicationUtilities.DisplayApplicationInformation method to reflect your name,.
Please be advised that there are four (4) programs just like this on.docxlorindajamieson
Please be advised that there are four (4) programs just like this one that are required. Please follow the instructions listed in each word document. The programs build upon one another and need to be saved to a zip file just like the zip file labeled "CIS247_WK2_Lab_Rosado.zip". Zip file CIS247_WK2_Lab_Rosado.zip is the program from which you start to build from.
STEP 1: Understand the UML Diagram
Analyze and understand the object UML diagram, which models the structure of the program.
There are no design changes to the Presentation Tier from the previous project and InputUtilities and ApplicationsUtilities classes are used without modification (except for changing the Application Information).
The default values for each of the attributres have been declared as a constants, which is indicated by the ALL_CAPS in the name, and the attributes are then set using the default values
Each of the attributes have been specified as private.
The accessors (get) and mutators (set) are not shown on the class diagram, but it is
ASSUMED
that each private attribute has a corresponding property that contains the get and set methods.
The "static" modifier for the numEmployees attribute means that there is only one copy of the variable that is then shared by all the objects of the class.
There is a second CalculatePay method that overloads the existing CalculatePay method
While not shown on the class diagram, the property for numEmployees will only have a get method, which means it will be a "read only" method. (A property with only and set method is a "write-only" property).
Image Description
What is depicted is a single column table with 3 rows. In the first row is the large word "Employee".
In the row beneath this is a list of private parameters, indicated with a "minus" symbol before them (but no space after). These are:
-MIN_DEPENDENTS int =0
-MAX_DEPENDENTS int = 10
-MIN_SALARY double = 20000
MAX_SALARY double = 20000
DEFAULT_NAME string = "Not given"
DEFAULT_GENDER char = 'U'
-firstName : String
-lastName : string
-gender : char
-dependents : int
-annualSalary : double
-static numEmployees: int = 0
In the third and final row beneath this is another list of public parameters, indicated with a "plus" symbol before them (but no space after). These are:
+Employee()
+Employee(in first : string, in last : string, in gen : char, in dep : int, in salary : double)
+ToString : string
+CalculateWeeklyPay() : double
+CalcuateWeeklyPay(modifiedSalary double)
Press the ESC key to close the image description and return to lecture.
STEP 2: Create the Project
You will want to use the Week 2 project as the starting point for the lab. To do this, you will want to create a new project by following these steps:
Create a new project named "CIS247_WK3_Lab_LASTNAME". An empty project will then be created.
Delete the default Program.cs file that is created.
Click on Project->Add Existing Item…. Select the .cs files containing the InputUtilities, ApplicationUtilities,.
Student Lab Activity A. Lab # CIS CIS170A-A1B. Lab.docxemelyvalg9
Student Lab Activity
A. Lab # CIS CIS170A-A1
B. Lab 5s of 7: Modularization
C. Lab Overview – Scenario / Summary:
TCOs:
TCO: 7
Given a set of program specifications for a simple business problem utilizing a modular design, code and test a program that meets the specifications and employs best programming practices.
TCO: 8
Given a set of program specifications for a simple business problem, code and test a program that implements methods with parameter lists that are passed as supported by the chosen programming language
This lab will familiarize the student with the process of modularizing his or her code.
D. Deliverables:
Step
Deliverable
Points
5
Program Listing, Output, and Project Files
45
The Dropbox deliverables include the following.
1. Include a zipped file with all the files from your Visual Basic project (see directions in Doc Sharing on how to collect and zip files.)
2. Create a single MS Word document and include the following.
· For each lab, copy and paste your code directly into the MS Word file.
· Include screenshot(s) of your test data with test results. Enter enough data to demonstrate that all your code has been tested.
· Include another screenshot of the Visual Basic build output messages. Check your build output to make sure you have a successful build with (0) errors and (0) warnings. NOTE: The build output messages appear at the bottom of your window after you click the Build menu and before you click the Start Without Debugging option. Your build output messages provide a list of compiler warnings or errors and let you know whether your program compiled successfully.
· Include the Word document as part of the zipped project file.
3. Upload each part of the lab into its corresponding weekly Dropbox.
E. Lab Steps:
Preparation:
If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home.
Locate the Visual Studio 2010 Icon on the desktop. Click to open.
Lab:
Step 1: Create a New Project
Create a new project in VB.NET. Name your project CIS170A_Lab05.
Practically every real-world professional program in existence today uses some type of modular design—this is just the way programs are designed and built. As a result, the primary objective of this lab is for you to understand how modular programs are designed and how data are passed between modules as the program is executing. This may be one of the most important lessons of this course, so it is critical that you focus on the modular design of the program; if you have any questions, post them to the Lab Forum threaded discussion.
In this project, we are going to use the Week 4 Hockey Player Statistics program that you created last week as a starting point and make a few minor changes in the program requirements. What you will do is take the existing project and with only slight modifications to the form design you will modularize the design of the code and then add a few new requirements. As you .
1 Goals. 1. To use a text file for output and later for in.docxhoney690131
1 Goals.
1. To use a text file for output and later for input.
2. To use exceptions and write an exception handler that does more than abort execution.
3. To Use a static class variable.
4. To use a boolean variable and a Date variable.
5. To use an ArrayList.
6. To implement Phase 1 of a four phase well-structured project with multiple classes using the Model-View-Controller design pattern (MVC).
2 Overview
This section discusses a finished application that you will construct in several phases. When all phases are finished, it will simulate a human resources system to keep track of savings through the company. There is a Human Resources Manager (Boss), and employees (eventually more than one type of employee will be used). Eventually, this system will be created as an application with a windows interface. The Employee’s login name will eventually be encrypted and the data will be stored in an object file. Program 4 implements only part of the menu, uses a text file and does not encrypt the employee data. At first this will be a menu-driven application allowing for these actions:
1. The first time the program is used, the user will enter his or her own data in to the program and will become the Boss (Human Resources Manager) with access to everyone’s data.
2. After that, when the program starts up, it will read in a database of employee data and store it in the employee collection.
3. After that, the Boss will be able to log in and create new employees by entering the person’s name (first, middle initial-optional, and last), login name, base salary, and savings percent. This data will be used to initialize a new employee object. The object will also record the current date and a unique ID number for this employee. The new employee will be added to the Employee collection.
4. The Boss can log in and display a list of all Employees in the collection and can change the base salary or percent savings for any employee. In the list, display the full name (first, middle initial and last), login name, Employee ID, base salary, percent savings and date of hire for each Employee.
5. Any Employee in the collection can log in and see his or her own data and change their name and percent savings (due to marriage, etc).
6. An Employee whose login name is in the collection may log in and out. Logging in will automatically log out the prior Employee.
7. The menu has an option to quit and quitting will cause the final contents of the collection to be written back to the database file (replacing it).
8. Since you have
more than one class
in this project, you will
need to create a package (call it “savings” – note the first letter is lower case)
and put all of the classes in the package. To tell your program to look for the other classes, you need to put the following in each class file near your import statements.
package
savings;
3 The Employee Class: Superclass of the Model (from MVC) for this application.
a) An object of type Employ ...
need help completing week 6 ilab.. i will upload what I currently ha.docxniraj57
need help completing week 6 ilab.. i will upload what I currently have if you know the material please let me know. what the person to add on to what I currently have started.
iLab 6 of 7: Login and Security Levels (30 Points)
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/Summary
In this week's lab, we will create a login form, validate a user based on their login name and password, and allow them to access the system or not. We will assign a session variable to determine the level of security the user has and allow certain functions to be displayed or not displayed in the existing frmPersonnel form depending on the assigned security level. (NOTE: In some cases the instructions for this lab will be less specific than in earlier labs, because you are expected to apply what you have learned in earlier weeks. Refer to the detailed instructions in previous weeks' labs if you need to do so.)
Instructions for Week 6 iLab: Login and Security Levels
Click on the link above to view the tutorial.
Please watch this tutorial before beginning the iLab.
The tutorial has audio.
Deliverables
When you try to log in, if you use User Name = Mickey and Password = Mouse, the frmMain form should open with all links visible. If you use User Name = Minnie and Password = Mouse, the frmMain form should open with only the Salary Calculator, View Personnel, and Search options should be available. You will have a new option called Manage Users that will allow you to add new users and remove or update existing users. Once you have verified that it works, save your website, zip up all files, and submit in the Dropbox.
Note on database connections: We are using a SQLDataSource control for the Edit employees feature we added. You should be using the connection string stored in the web.config file for your database connection for this control. Rather than creating a new connection each time, just use this connection. If you change the folder where your website is (e.g., you copy each week's work to a new location), you will need to update the web.config. The advantage of using the database connection in the web.config is that you only have to set the configuration in one location.
Before starting this week's lab, make sure everything is working and that all database connections are properly configured.
i L A B S T E P S
STEP 1: Login Form (10 points)
Open Microsoft Visual Studio.NET 2008.
Click the ASP.NET website named PayrollSystem to open it.
Create a new web form named frmLogin.
Drop a login control onto the form.
Set the properties of the login control as follows:
PROPERTY
VALUE
DestinationPageUrl
frmMain.aspx
TitleText
Please enter your UserName and Password in order to log into the system
Add the
Cool
Biz
Productions
, Inc.
logo to the frmLogin form. Do not hylerlink the logo.
Highlight everything in the form, then c.
(Module: Capturing requirements : importing a document)
At the end of this lab you will be able to import requirements that were captured in an external CSV document, and create individual artifacts within the requirements management project.
Given
► The JKE Banking Money That Matters project
Description
► In this lab, you are Bob the analyst. You sent out a spreadsheet to your team collecting new requirements. The team filled in the spreadsheet and handed it back. You will import those requirements, into the JKE project.
Exercise Tasks
In this exercise, you will complete the following tasks:
► Task 1: Import requirements that were captured in an external CSV document
Similar to Cis247 a ilab 4 composition and class interfaces (20)
Enterprise Excellence is Inclusive Excellence.pdfKaiNexus
Enterprise excellence and inclusive excellence are closely linked, and real-world challenges have shown that both are essential to the success of any organization. To achieve enterprise excellence, organizations must focus on improving their operations and processes while creating an inclusive environment that engages everyone. In this interactive session, the facilitator will highlight commonly established business practices and how they limit our ability to engage everyone every day. More importantly, though, participants will likely gain increased awareness of what we can do differently to maximize enterprise excellence through deliberate inclusion.
What is Enterprise Excellence?
Enterprise Excellence is a holistic approach that's aimed at achieving world-class performance across all aspects of the organization.
What might I learn?
A way to engage all in creating Inclusive Excellence. Lessons from the US military and their parallels to the story of Harry Potter. How belt systems and CI teams can destroy inclusive practices. How leadership language invites people to the party. There are three things leaders can do to engage everyone every day: maximizing psychological safety to create environments where folks learn, contribute, and challenge the status quo.
Who might benefit? Anyone and everyone leading folks from the shop floor to top floor.
Dr. William Harvey is a seasoned Operations Leader with extensive experience in chemical processing, manufacturing, and operations management. At Michelman, he currently oversees multiple sites, leading teams in strategic planning and coaching/practicing continuous improvement. William is set to start his eighth year of teaching at the University of Cincinnati where he teaches marketing, finance, and management. William holds various certifications in change management, quality, leadership, operational excellence, team building, and DiSC, among others.
Building Your Employer Brand with Social MediaLuanWise
Presented at The Global HR Summit, 6th June 2024
In this keynote, Luan Wise will provide invaluable insights to elevate your employer brand on social media platforms including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok. You'll learn how compelling content can authentically showcase your company culture, values, and employee experiences to support your talent acquisition and retention objectives. Additionally, you'll understand the power of employee advocacy to amplify reach and engagement – helping to position your organization as an employer of choice in today's competitive talent landscape.
The world of search engine optimization (SEO) is buzzing with discussions after Google confirmed that around 2,500 leaked internal documents related to its Search feature are indeed authentic. The revelation has sparked significant concerns within the SEO community. The leaked documents were initially reported by SEO experts Rand Fishkin and Mike King, igniting widespread analysis and discourse. For More Info:- https://news.arihantwebtech.com/search-disrupted-googles-leaked-documents-rock-the-seo-world/
Cracking the Workplace Discipline Code Main.pptxWorkforce Group
Cultivating and maintaining discipline within teams is a critical differentiator for successful organisations.
Forward-thinking leaders and business managers understand the impact that discipline has on organisational success. A disciplined workforce operates with clarity, focus, and a shared understanding of expectations, ultimately driving better results, optimising productivity, and facilitating seamless collaboration.
Although discipline is not a one-size-fits-all approach, it can help create a work environment that encourages personal growth and accountability rather than solely relying on punitive measures.
In this deck, you will learn the significance of workplace discipline for organisational success. You’ll also learn
• Four (4) workplace discipline methods you should consider
• The best and most practical approach to implementing workplace discipline.
• Three (3) key tips to maintain a disciplined workplace.
Digital Transformation and IT Strategy Toolkit and TemplatesAurelien Domont, MBA
This Digital Transformation and IT Strategy Toolkit was created by ex-McKinsey, Deloitte and BCG Management Consultants, after more than 5,000 hours of work. It is considered the world's best & most comprehensive Digital Transformation and IT Strategy Toolkit. It includes all the Frameworks, Best Practices & Templates required to successfully undertake the Digital Transformation of your organization and define a robust IT Strategy.
Editable Toolkit to help you reuse our content: 700 Powerpoint slides | 35 Excel sheets | 84 minutes of Video training
This PowerPoint presentation is only a small preview of our Toolkits. For more details, visit www.domontconsulting.com
Premium MEAN Stack Development Solutions for Modern BusinessesSynapseIndia
Stay ahead of the curve with our premium MEAN Stack Development Solutions. Our expert developers utilize MongoDB, Express.js, AngularJS, and Node.js to create modern and responsive web applications. Trust us for cutting-edge solutions that drive your business growth and success.
Know more: https://www.synapseindia.com/technology/mean-stack-development-company.html
3.0 Project 2_ Developing My Brand Identity Kit.pptxtanyjahb
A personal brand exploration presentation summarizes an individual's unique qualities and goals, covering strengths, values, passions, and target audience. It helps individuals understand what makes them stand out, their desired image, and how they aim to achieve it.
Buy Verified PayPal Account | Buy Google 5 Star Reviewsusawebmarket
Buy Verified PayPal Account
Looking to buy verified PayPal accounts? Discover 7 expert tips for safely purchasing a verified PayPal account in 2024. Ensure security and reliability for your transactions.
PayPal Services Features-
🟢 Email Access
🟢 Bank Added
🟢 Card Verified
🟢 Full SSN Provided
🟢 Phone Number Access
🟢 Driving License Copy
🟢 Fasted Delivery
Client Satisfaction is Our First priority. Our services is very appropriate to buy. We assume that the first-rate way to purchase our offerings is to order on the website. If you have any worry in our cooperation usually You can order us on Skype or Telegram.
24/7 Hours Reply/Please Contact
usawebmarketEmail: support@usawebmarket.com
Skype: usawebmarket
Telegram: @usawebmarket
WhatsApp: +1(218) 203-5951
USA WEB MARKET is the Best Verified PayPal, Payoneer, Cash App, Skrill, Neteller, Stripe Account and SEO, SMM Service provider.100%Satisfection granted.100% replacement Granted.
B2B payments are rapidly changing. Find out the 5 key questions you need to be asking yourself to be sure you are mastering B2B payments today. Learn more at www.BlueSnap.com.
Business Valuation Principles for EntrepreneursBen Wann
This insightful presentation is designed to equip entrepreneurs with the essential knowledge and tools needed to accurately value their businesses. Understanding business valuation is crucial for making informed decisions, whether you're seeking investment, planning to sell, or simply want to gauge your company's worth.
Recruiting in the Digital Age: A Social Media MasterclassLuanWise
In this masterclass, presented at the Global HR Summit on 5th June 2024, Luan Wise explored the essential features of social media platforms that support talent acquisition, including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok.
Implicitly or explicitly all competing businesses employ a strategy to select a mix
of marketing resources. Formulating such competitive strategies fundamentally
involves recognizing relationships between elements of the marketing mix (e.g.,
price and product quality), as well as assessing competitive and market conditions
(i.e., industry structure in the language of economics).
1. CIS247A iLab 4 Composition and Class
Interfaces
Click this link to get the tutorial:
http://homeworkfox.com/tutorials/general-
questions/4463/cis247a-ilab-4-composition-
and-class-interfaces/
Week 4: Designing Using Objects - iLab
Print This
Page
iLab 4 of 6: Composition and Class Interfaces/Abstract 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.)
iLAB OVERVIEW
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.
2. 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.
iLAB STEPS
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() : double
+setAnnualSalary(in sal : double) : void +setAnnualSalary(in sal : String) : void <<interface>> Fido : Animal +calculatePay() :
double Benefit -healthinsurance : string -lifeinsurance : double -vacation : int +Benefit() +Benefit(in health : string, in life :
double, in vacation : int) +displayBenefits() : void +getHealthInsurance() : string +setHealthInsutance(in hins : string) : void
+getLifeInsurance() : double +setLifeInsurance(in lifeIns : double) : void +getVacation() : int +setVacation(in vaca : int) : void
The only change to the Employee class is that there is a new attribute:
+benefit : Benefit
Notice that there is a "+" for this attribute, meaning that it is public. Make sure to examine the multi-arg
constructor's signature!
Also, the dotted directed line between Employee and iEmployee specifies that the Employee class must
implement the iEmployee abstract class, and thus provide an implementation for the calculatePay
method.
STEP 2: Create the Project
You will want to use the Week 3 project as the starting point for the lab. To do this, you will want to create
a new project by following these steps:
1. Create a new project and name it "CIS247C_WK4_Lab_LASTNAME".
2. Copy all the source files from the Week 3 project into the Week 4 project.
3. Before you move on to the next step, build and execute the Week 4 project.
STEP 3: Modify the Employee Class
3. 1. Using the UML Diagrams from Step 1, create the Benefit class. To get an idea of how to format
displayBenefits, take a look at the output in Step 5.
2. Add a Benefit attribute to the Employee class.
3. Initialize the new Benefit attribute in both Employee constructors. Again, take note of the multi-arg
constructors parameter list!
4. Create the iEmployee interface (abstract class in C++).
5. Modify the Employee class to implement the new interface so that Employee will have to
implement the calculatePay method.
class Employee : public iEmployee
6. Modify the Employee class to call displayBenefit when displaying Employee information.
STEP 4: Modify the Main Method
Notice that the Employee class now has a public benefit object inside it. This means that you can access
the set methods of the Benefit object with the following code:
<Employee object>.benefit.<method>
As an example, to set the lifeInsurance attribute inside an Employee object called emp, we could execute
the following code:
emp.benefit.setLifeInsurance(lifeInsurance);
The steps required to modify the Main class are below. New steps are in bold.
1. Create an Employee object using the default constructor.
2. Prompt for and then set the first name, last name, and gender. Consider using your getInput
method from Week 1 to obtain data from the user for this step as well as Step 3.
3. Prompt for and then set the dependents and annual salary using the overloaded setters that
accept Strings.
4. Prompt for and set healthInsurance, lifeInsurance, and vacation.
5. Using your code from Week 1, display a divider that contains the string "Employee Information".
6. Display the Employee Information.
7. Display the number of employees created using getNumEmployees(). Remember to access
getNumEmployees using the class name, not the Employee object.
8. Create a Benefit object called benefit1 using the multi-arg construction. Use any
information you want for health insurance, life insurance, and vacation.
9. Create another Employee object and use the constructor to fill it with the following:
"Mary", "Noia", 'F', 5, 24000.0, benefit1
10. Using your code from Week 1, display a divider that contains the string "Employee Information".
11. Display the employee information.
12. Display the number of employees created using getNumEmployees(). Remember to access
getNumEmployees using the class name, not the Employee object.
STEP 5: Compile and Test
4. 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.
STEP 6: Screen Prints
Capture the Console output window and paste it into a Word document. The following is a sample screen
print.
Screenshot of program output that reads: CIS247CWeek4iLab' CMD.EXE was started with the above path as the current
directory. UNC paths are not supported. Defaulting to Windows directory. Welcome to your Object Oriented Program--
Employee ClassCIS247C, Week 4 LabName: Prof.Nana Liu *************** Employee 1 *************** Please enter your First
Name Nana Please enter your Last Name Liu Please enter your Gender Female Please enter your Dependents 2 Please
enter your Annual Salary 60000 Please enter your Health InsuranceCigna Please enter your Life Insurance1.5 Please enter
your Vacation Days21 Employee Information ________________________________________ Name: Nana Liu Gender: F
Dependents: 2 Annual Salary: 60000.00 Weekly Salary: 1153.85 Benefit Information
________________________________________ Health Insurance: Cigna Life Insurance: 1.50 Vacation: 21 days ---
Number of Employee Object Created --- Number of employees: 1 ************** Employee 2 ************** Employee
Information _______________________________________ Name: Mary Noia Gender: F Dependents: 2 Annual Salary:
150000.00 Weekly Salary: 2884.62 Benefit Information _______________________________________ Health Insurance:
North West Mutual Life Insurance: 5000000.00 Vacation: 14 days --- Number of Employee Object Created --- Number of
employees: 2 The end of the CIS247C Week4 iLab. Press any key to continue...
STEP 7: Submit Deliverables
Capture the Console output window and paste it into a Word document.
Put the zip file and screen shots (Word document that contains programming code and screen
shots of program output) 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 these Step-by-Step Instructions or watch this Dropbox Tutorial.
See Syllabus "Due Dates for Assignments & Exams" for due date information.