For Online Class Help or Private Tutoring Service email us at [email protected] or WhatsApp us at +1 (781) 656-7669

Homework Provider

 
  • Take My Class
  • Take My Exam
  • How It Works
  • Solutions
    • Questions
  • Testimonials
  • Blog
  • Who Are We
  • Contact Us
  • Take My Class
  • Take My Exam
  • How It Works
  • Solutions
    • Questions
  • Testimonials
  • Blog
  • Who Are We
  • Contact Us
  1. Home
  2. Questions
  3. DeVry CIS 247A Week 4 iLab Composition and Class Interfaces

Contents

  • 1 DeVry CIS 247A Week 4 iLab Composition and Class Interfaces
    • 1.1 iLAB STEPS
  • 2 STATUS
  • 3 STATUS

DeVry CIS 247A Week 4 iLab Composition and Class Interfaces

Scenario and Summary
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:

  1. Create a Benefit class.
  2. Integrate the Benefit class into the Employee class.
  3. Separate the files in the project into Presentation and Logic tier folders Deliverables
  4. Before you post your lab in the dropbox, copy your entire program into a Notepad file and post that. I do not need you to zip the project or give me screenshots of the output.

iLAB STEPS

STEP 1: Understand the UML Diagram

  1. 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).
  2. A new class called Benefits that holds the health insurance company, life insurance amount, and vacation days. There are constant attributes defined for each of the default values and the minimum and maximum values. This composition relationship is specified in the UML class diagram as a solid diamond connecting to the Employee class.
  3. The Benefits class shall contain properties that contain get and set methods for each of the attributes in the Benefits class, and each attribute value shall be properly validated in the properties.
  4. The Employee class contains a new attribute called benefit that is of type Benefits. There will be a property in the Employee class that can set and get the benefit attribute.
  5. Each constructor of Employee class will need to instantiate the benefit attribute.

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 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 hierarchy 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 similar to creating folders in Windows Explorer. Follow these directions to create the folders:

take-my-online-class-thumbnail
Play Video
pay-someone-to-take-my-online-class

Name: Jennifer Lucas
Status: Online ⬤
Classes Taken: 3878
Ratings: ⭐⭐⭐⭐⭐

Hire Me

STATUS

 

  1. Select the project and then right-click
  2. Select Add
  3. Select New Folder
  4. Enter the name of the folder
  5. Add the following three folders to your project (1) Presentation Tier, (2) Logic Tier, and (3) Utilities.
  6. 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
  7. Select the Logic Tier 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!]
  8. Add the previous week‟s Employee.cs file to the Logic Tier folder.
  9. Add the ApplicationUtilities.cs file to the Utilities folder.
  10. 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).
  11. The namespaces for the classes should all be “Employee”, but you should verify that the namespaces for all the classes are the same.
  12. Update the program information in the ApplicationUtilities.DisplayApplicationInformation method to reflect your name, current lab, and program description.
  13. Build and execute the project.

STEP 3: Create the Benefits Class

Using the Benefit class diagram as a guide, build the Benefit class.

  1. Create a property for each of the listed private attributes and validate the provided value using the following rules:
    1) If the insurance company provided is empty or null then set the health insurance company to DEFAULT_HEALTH_INSURANCE
    2) If the provided life insurance value is between the MIN_LIFE_INSURANCE and MAX_LIFE_INSURANCE (inclusive) then set lifeInsuranceAmount to the provided value; if the provided value is less than MIN_LIFE_INSURANCE set the life insurance amount to MIN_LIFE_INSURANCE; else if provided value is greater than MAX_LIFE_INSURANCE; set thelifeInsuranceAmount to MAX_LIFE_INSURANCE.
    3) If the provided vacation days value is between the MIN_VACATION and MAX_VACATION (inclusive) the set the vacationDays to the provided value; if the provided value is less than MIN_VACATION set the vacationDays to MIN_VACATION; else if the provided value is greater than MAX_VACATION set the vacation days value to MAX_VACATION.
  2. In the parameterized constructor, set the attributes so that the properties are used, which ensures that attributes are validated prior to be set.
  3. Create an overridden ToString method that collects and formats the attribute information for
    the benefit object. Ensure to display life insurance amount in currency format.

STEP 4: Modify the Employee Class

Using the Employee class diagram as a guide, modify the Employee class

  1. Add a private attribute called “benefit” to the employee class of type Benefits
  2. Create a public Benefit property that returns the benefit attribute. In the set method of the property, if the provided value is null then re-instantiate the benefit variable; otherwise, set the provided value to the benefit variable. [Hint: to check if a object is a null use the syntax “if (object != null)”]
  3. In the default constructor, instantiate the benefit variable using the Benefits default constructor
  4. In the parameterized constructor, add a benefit argument of type Benefits, and then set the value of this parameter to the Benefit property (using the property will ensure that any null benefit object is correctly instantiated.)
  5. Modify the ToString method to the Employee class, by adding a call to the Benefits ToString methods at the end of the Employee ToString method.

STEP 5: Modify the Main Method

In the previous labs you learned how to access an object/class method and properties using the DOT notation. For example, to access the calculate pay method of an employee object you used a statement similar to:

  1. employee1.CalculateWeeklyPay(modifiedSalary)
  2. Notice that the Employee class now has a public Benefit object inside it. This means that you can access the set
  3. methods of the Benefit object using the transitive notation: containingObject.containedObject.methodName()
  4. or containingObject.containedObject.PropertyName
  5. That is to access the members of the contained object, you start at the containing object, then “transit” to the contained object, then to the contained object’s members.
  6. As an example, to set the life insurance amount of an employee object, the statement would look something like:
  7. employee1.Benefit.LifeInsuranceAmount = 100000;
  8. Notice, the containing object is “employee1′′, the contained object is “Benefit”, and the property of Benefit we are accessing is LifeInsuranceAmount.

The code in the previous week‟s project performed the following operations

take-my-online-class-thumbnail
Play Video
pay-someone-to-take-my-online-class

Name: Jennifer Lucas
Status: Online ⬤
Classes Taken: 3878
Ratings: ⭐⭐⭐⭐⭐

Hire Me

STATUS

 

  1. Display the program information.
  2. Create an Employee object using the default constructor.
  3. Prompt for and then set the first name, last name, gender, dependents, and annual salary. Remember to use the appropriate methods in the InputUtilties class to prompt for and retrieve the values.
  4. Display the employee information.
  5. After the first employee information is provided, display the number of employees created.
  6. Prompt the user to provide an updated annual salary for employee1, retrieve the value and invoke the overloaded CalculateWeeklyPay, and then display only the updated weekly pay.
  7. Create a second Employee object using the multi-argument constructor using data of your choosing that is of the correct type for each input.
  8. Display the Employee information for the second employee object.
  9. Create a third Employee object using the parameterized constructor setting each of the attributes with the following values: “Sue”, “Smith”, „F‟, 15, 500000.0
  10. Display the employee information for the third Employee object and verify that the dependents and annual salary values have been set to the maximum values by the properties. If not, make sure you change the parameterized constructor to use the properties to set the attributes.
  11. Display the number of employees created.
  12. Terminate the application

Once your code is working and implements the previous week‟s operations, modify the code to implement the following new requirements (updated code should implement all previous requirements except as noted below).

  1. After you collect the information for the first employee object, prompt for and collect the Health Insurance Company, the LifeInsuranceAmount, and the number of vacation days.
  2. Display the updated employee 1 information
  3. Display the number of employees created.
  4. Create a new, standalone benefits object using the multi-argument constructor using data of your choosing that is of the correct type for each input.
  5. Modify the second employee object instantiation and add the newly created benefit object to the constructor call.
  6. Display the updated employee 2 information
  7. Display the number of employees created.
  8. Create a new, standalone benefits object using the multi-argument constructor using the following invalid data “” (empty string), 10000000, -10
  9. Modify the third employee object instantiation and add the newly created benefit object to the constructor call.
  10. Display the updated employee 3 information and verify that the default values for the benefit object have been correctly set.
  11. Display the number of employees created.

STEP 6: Compile and Test

When done, compile and execute your code. Debug 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. The following shows some sample output, but your output may look different.

Facebook
Twitter
Reddit
Pinterest
WhatsApp
Email
pdf-answers
Get Solved Answers
$2.99
Add to cart

GET QUICK PRICE ESTIMATE FOR THIS TASK

WHY CHOOSE US

  • Over 300 Experts to Work on Your Papers
  • 100% Privacy and Confidentiality
  • Amazing Discounts and Special Offers
  • Delivery within Every Deadline Level
  • Secure Payment Process
  • High-Quality Papers
  • 24/7 Live Customer Support
  • Free Revisions If Required
  • Fair & Cheap Prices
  • Rated 4.9/5 By Students

COMPLETED TASKS

SOCS 325 Week 8 Final Exam (Version 2)

July 13, 2020

SOCS 325 Week 8 Final Exam (Version 1)

July 13, 2020

SOCS 325 Week 8 Final Exam (Collection)

July 13, 2020

SOCS 325 Week 8 Collaborative Group Project Discussion

July 13, 2020

SOCS 325 Week 7 Bundle: Assignments + Group Project + Discussions

July 13, 2020

SOCS 325 Week 6 Bundle: Assignments + Discussions

July 13, 2020

SOCS 325 Week 5 Bundle: Assignments + Discussions

July 13, 2020

SOCS 325 Week 4 Midterm (Version 4)

July 13, 2020

Homework Provider

Facebook-f Twitter Pinterest Whatsapp Reddit Envelope

WE ACCEPT

PayPal
VISA Light
AMERICAN EXPRESS LIGHT
Bitcoin
  • Take My Online Class
  • Do My Case Study
  • Take My Online Exam
  • Online Class Help
  • Do My Homework
  • Take My Online Test
  • Original Homework Help
  • Premium Plagiarism Checker
  • Take My Midterm Exam
  • Research Paper Writing
  • Case Study Writing Help
  • Dissertation Writing Service
  • Online Coursework Help
  • Pay Someone To Write My Paper
  • Pay For Online Classes
  • Programming Classes Help
  • MyMathLab Answers
  • MyStatLab Answers
  • MyAccountingLab Answers
  • Need Help With Online Class
  • Cheap Assignment Help
  • Write My Online Essay
  • Online Student Problems
  • Math Homework Help

Contact Us

  • [email protected]
  • WhatsApp (781) 656-7669
  • twitter.com/hwp_helper
  • fb.com/homeworkprovidercom
  • Privacy Policy
  • Terms of Use
  • DMCA
  • Cookie Policy
  • Money Back Guarantee
  • Premium Plagiarism Checker
  • Contact Us

HomeworkProvider.com is not endorsed or affiliated by any university or college. The services provided are meant to assist the client by providing a guideline and the product provided is intended to be used for research or study purposes.

© 2013-2020 HomeworkProvider. All rights reserved.

ORDER THIS
WHATSAPP

Yay! You are just one step away to get rid of homework stress

  • How It Works
  • Testimonials
  • We are committed to ensuring that your information is secure with us
hire-an-expert-to-do-my-exam

Don't Waste Your Time Searching For Old Plagiarized Courses

Get Your Job Done By Our Anonymous Quality Experts

  • How It Works
  • Reviews
  • 24/7 Support
doc icon homework provider

CIS 155 Lab Help, Leslie​
Thank you for doing my CIS 115 lab. Homework Provider is the best.

Rated By Client
 5/5
doc icon homework provider

Dream Service, William
Thanks God, you came to my rescue. Thanks for your help.

Rated By Client
 5/5
doc icon homework provider

Mind blowing service, Eddie
I could have failed quite a few exams if you guys did not help me

Rated By Client
 5/5
doc icon homework provider

Got A grade in final exam, John
I still couldn’t believe I got an A grade in my exam. Highly vouched service.

Rated By Client
 5/5
doc icon homework provider

Linda, opted for private tutoring
Subscribed to get online class help for devry acct 212 week 1-8 class​​

Week 5 65%
doc icon homework provider

Acct Course Project, Ryan
Thanks a lot to my writer who followed all my requirements.

Rated By Client
 5/5
xls-icon

Genuine service, Steven
The research paper was much more than I expected! Thanks a lot.

Rated By Client
 4.5/5
doc icon homework provider

Karen, opted for private tutoring
Subscribed to get online class help for liberty BUSI 536 week 1-8 class.

Week 7 88%
doc icon homework provider

Marcus, opted for private tutoring
Subscribed to get online class help for ashford psy week 1-5 class.

Week 3 58%
doc icon homework provider

I got A grade in class, Amanda
with the help of homework provider I made it to pass my acct 505 class.

Rated By Client
 5/5