Discount CIS247 CIS 247 CIS/247 - CIS247C - C++ Programming - All Week - All Lab - All iLab - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7 – Guaranteed 100% score
    CIS247 CIS 247 CIS/247 - CIS247C - C++ Programming - All Week - All Lab - All iLab - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7 – Guaranteed 100% score CIS247 CIS 247 CIS/247 - CIS247C - C++ Programming - All Week - All Lab - All iLab - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7 – Guaranteed 100% score CIS247 CIS 247 CIS/247 - CIS247C - C++ Programming - All Week - All Lab - All iLab - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7 – Guaranteed 100% score

CIS247 CIS 247 CIS/247 - CIS247C - C++ Programming - All Week - All Lab - All iLab - Week 1 - Week 2 - Week 3 - Week 4 - Week 5 - Week 6 - Week 7 – Guaranteed 100% score

$83.95
$111.93

iLab 1 of 7: Creating a User Interface
i L A B O V E R V I E W

Scenario and Summary
This program creates the basic user interface code that can be used in the following week’s iLab assignments. The assignment will help you get started using the programming environment and some practice with coding. You will also be able to reuse much, if not all, of the code in later assignments.
In this program, you will create the following methods:

  1. DisplayApplicationInformation, which will provide the program user some basic information about the program.
  2. DisplayDivider, which will provide a meaningful output separator between different sections of the program output.
  3. GetInput, which is a generalized function that will prompt the user for a specific type of information, then return the string representation of the user input.
  4. TerminateApplication, which provides a program termination message and then terminates the application.

Using these methods, you will construct a program that prompts the user for the following:

  1. your name, which will be a string data type;
  2. your age, which will be an integer data type;
  3. the gas mileage for your car, which will be a double data type; and
  4. a display of the collected information.

Also, note that the program should contain a well-documented program header.
Deliverables
Step Deliverable

Step 4 Screenshot of running program results
Step 5 Zip file with entire Lab files
Preparation:

  • If you are using the Citrix remote lab, follow the login instructions located in the iLab tab in Course Home.
  • Locate the Microsoft Visual Studio icon and launch the program.

i L A B S T E P S
STEP 1:
Review the Design

Download the program description and puesdocode design, and make sure you fully understand the program design and ask any questions that you may have BEFORE you start programming.
Click Week 1 Lab Design to download program design.
STEP 2: Construct the Program

  1. Start Microsoft Visual Studio and create a new project titled “CIS247C_WK1_Lab_LASTNAME”.
  2. Using the design, construct the methods.
  3. Once the methods are constructed, use the design to create the main program.

STEP 3: Compile and Test

  1. When done, ensure that there are no compile errors. If there are errors, open up the Error list and fix all listed errors.
  2. Execute your code and check your output to ensure that you have the desired output. If you need to fix anything, close your execution window, modify your code as necessary, and rebuild.

STEP 4: Screen Prints

Capture the results of each test and paste them into a Word document. Below is a sample program output.

Screenshot of a program output that reads:

Welcome to your first Object Oriented Program–Employee ClassCIS247C, Week 2

Lab Name: Prof.Nana Liu

*************** Start Program ***************

*************** Get Name ***************

Please enter your name Nana Liu

Your name is: Nana Liu

*************** Get Age ***************

Please enter your age100 Your age is: 100

*************** Get Mileage ***************

Please enter your mileage 52.16

Your car MPG is: 52.16

The end of the CIS247C Week1 iLab.

Press any key to continue. . .

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Week 2: Object Construction and Data Abstraction – iLab
iLab 2 of 7: Employee Class
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:

  1. Capture the Console output window and paste it into a Word document.
  2. Zip the project folder files.
  3. 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.
The following header files need to be included to support input/output, string processing and formatting services -
#include <iostream>
#include <string>
#include <stdlib.h>
#include <iomanip>
In this class Employee, we will need to declare five data members:
- firstName: string
- lastName: string
- gender: char
- dependents: int
- annualSalary: double
In addition, we will need to declare two constructors –
·    Employee()//default constructor
·    Employee(string firstName, string lastName, char gender, int dependents, double salary) //create a parameterized constructor
A series of getters and setters methods for get and set the following data members –
- firstName     
  string getFirstName() { }
  void setFirstName(string name) {  }
- lastName
  string getLastName() { }
  void setLastName(string name) { }      
- gender
  char getGender() { }
  void setGender(char gen) { }      
- dependents  
  int getDependents() { }
  void setDependents(int dep) { }      
- annualSalary
  double getAnnualSalary() { }
  void setAnnualSalary(double salary) { }
A calculatePay() method that calculates the weekly pay:
  double calculatePay() { }
A displayEmployee() method that displays all the employee information -
  void displayEmployee() { }

STEP 2: Code the Employee Class

1.    Create a new project called "CIS247B_Week2Lab_YourName".
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, and annualSalary = 20,000.

Based on the given value, we just need to assign all the default values to the data members in the constructor:
Employee()//default constructor
{
                   firstName = "not given";
                   lastName = "not given";
                   gender = 'U';
                   dependents = 0;
                   annualSalary = 20000;
}
4.    The multi-arg constructor should initialize all of the attributes using values passed in using its parameter list.
Employee(string firstName, string lastName, char gender, int dependents, double salary)
{
//use the this pointer to distinguish between the class attributes and the parameters
                   this->firstName = firstName;
                   this->lastName = lastName;
                   this->gender = gender;
                   this->dependents = dependents;
                   this->annualSalary = salary;
}
5.    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 getters simply returns the data member for outside of class access
       string getFirstName()
          {
                   return firstName;
          }
 The setters allows validation and reassigning values to the data member
          void setFirstName(string name)
          {
                   firstName = name;
          }
6.    The calculatePay( ) method of the Employee class should return the value of annual salary divided by 52 (return annualSalary / 52;).
double calculatePay(){return annualSalary/52;}
7.    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!
When we display the annualSalary and weekly pay, we need to apply appropriate formatting so the dollar amount can be displayed in a neat two digit format.
void displayEmployee()
          {
                   cout<<"Employee Information\n";
                   cout<<"______________________________________________________\n";
                   cout<<"Name: \t\t" <<firstName << " " << lastName << "\n";
                   cout<<"Gender:\t\t" << gender << "\n";
                   cout<<"Dependents: \t" << dependents << "\n";
                   cout<<"Annual Salary:\t" << setprecision(2)<<showpoint<<fixed<<annualSalary << "\n";
                   cout<<"Weekly Salary:\t" << setprecision(2)<<showpoint<<fixed<<calculatePay();
          }

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. Format the currency using the following formatting services:
  1. cout<<"Annual Salary:\t" << setprecision(2)<<showpoint<<fixed<<<="" "\n";
  1. Display the Employee information.
  2. Create a second Employee object using the multi-argument constructor, setting each of the attributes with appropriate valid values.
  3. Using your code from last week, display a divider that contains the string "Employee Information".
  4. 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.
STEP 5: Screen Prints

Capture the Console output window and paste into a Word document. The following is a sample screen.

Screenshot of a program output that reads:

Welcome to your first Object Oriented Program--Employee ClassCIS247C, Week 2

Lab Name: Prof.Nana Liu

*************** Employee 1 ***************

Please enter your First Name Nana

Please enter your Last Name Liu

Please enter your Gender F

Please enter your Dependents 2

Please enter your Annual Salary 60000

Employee Information

 ___________________________________________

Name: Nana Liu

Gender: F

Dependents: 2

Annual Salary: 60000.00

Weekly Salary 1153.85

The end of the CIS247C Week 1 iLab. Press any key to continue...
STEP 6: Submit Deliverables

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

iLab 3 of 7: Overloaded Methods and Static Methods / Variables

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 static variable called numEmployees that holds an int and initialize it to zero. This will allow us to count all the Employee objects created in the main class.
  2. Increment numEmployees in all of the constructors
  3. Add overloaded versions of setDependents and setAnnualSalary that accept strings. This way, we will have two "set" methods for both dependents and annual salary; one that accepts a string, and one that accepts its default data type.

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 +Employee() +Employee(in first : String, in last : String, in gen : char, in dep : int, in sal : double) +calculatePay() : double +displayEmployee() : void +static getNumEmployees() : int +getFirstName() : String +setFirstName(in first : String) : void +getLastName() : String +setLastName(in last : String) : void +getGender() : char +setGender(in gen : char) : void +getDependents() : int +setDependents(in dep : int) : void +getAnnualSalary() : double +setAnnualSalary(in salary : double) : void +setAnnualSalary(in salary : String) : void

  • The following attribute has been added:
    - static numEmployees: int = 0
  • The following behaviors have been added:
    + static getNumEmployees( ) : int
    + setDependents(in dep : String) : void
    + setAnnualSalary(in sal : String) : void

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. Open the same workspace you created for the Week 2 project.
  2. Create a new project named "CIS247B_WK3_Lab_LASTNAME". An empty project will then be created.
  3. Copy your main class and employee class files from Week 2 and paste them into the Week 3 project.
  4. Before you move on to the next step, build and execute the Week 3 project.

For each week's assignments, you will follow these steps create a new project that reuses the program from the previous week.

STEP 3: Modify the Employee

 

Using the UML Diagrams from Step 1, code the changes to the Employee class.

  1. Create a static numEmployees variable and initialize it to zero.
  2. Increment numEmployees by 1 in each of the constructors.
  3. Create an overloaded setDependents method and, this time, make the parameter a string.
  4. Create an overloaded setAnnualSalary method and, this time, make the parameter a string.
    Remember that you will have to convert the string in the above two "set" methods to the data type of the attribute.
  5. Make the getNumEmployees a static method. (This way, you can call it with the class name instead of an object name.)

Be sure you follow proper commenting and programming styles (indentation, line spacing, etc.).

STEP 4: Modify the Main Method

 

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.). Note that several of the steps below were accomplished in last week's assignment. 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 dependents and annual salary using the new overloaded setters.
  4. Using your code from Week 1, display a divider that contains the string "Employee Information".
  5. Display the Employee Information.
  6. Display the number of employees created using getNumEmployees. Remember to access getNumEmployees using the class name, not the Employee object.
  7. Create a second Employee object using the multi-arg constructor, setting each of the attributes with the following values: "Mary", "Noia", 'F', 5, 24000.0
  8. Using your code from Week 1, display a divider that contains the string "Employee Information".
  9. Display the employee information for the second Employee object.
  10. 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

 

When done, compile and run your code. 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 program that reads:

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

First Name: John

Last Name: Doe

Gender: M

Dependents: 7

Annual Salary: $32,500.00

Weekly Pay: $625.00

Total employees: 1

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

First Name: Mary

Last Name: Noia

Gender: F

Dependents: 5

Annual Salary: $24,000.00

Weekly Pay: $461.54

Total employees: 2

STEP 6: Submit Deliverables

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

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

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:

  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

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:

  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

 

  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

  1. 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.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 iLab 5 of 7 – Composition, Inheritance, and Polymorphism

The objective of the lab is to take the UML Class diagram and enhance last week's Employee class by making the following changes:

Create a class called Salaried that is derived from Employee.

Create a class called Hourly that is also derived from Employee.

Override the base class calculatePay() method.

Override the displayEmployee() method.

iL 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.

Employee #firstName : string #lastName : string #gender : char #dependents : int #annualSalary : double #benefit : Benefit -static numEmployees : int = 0 +Employee() +Employee(in fname : string, in lname : string, in gen : char, in dep : int, in benefits : Benefit) +static getNumEmployees() : int +CalculatePay() : double +displayEmployee() : void Benefit -healthinsurance : string -lifeinsurance : double -vacation : int +Benefit() +Benefit(in hins : string, in lins : double, in vac : int) +displayBenefits() : void Salaried -MIN_MANAGEMENT_LEVEL : int = 0 -MAX_MANAGEMENT_LEVEL : int = 3 -BONUS_PERCENT : double = 10 -managementLevel : int +Salaried() +Salaried(in fname : string, in lname : string, in gen : char, in dep : int, in sal : double, in ben : Benefit, in manLevel : int) +Salaried(in sal : double, in manLevel : int) +CalculatePay() : double +displayEmployee() : void Hourly -MIN_WAGE : double = 10 -MAX_WAGE : double = 75 -MIN_HOURS : double = 0 -MAX_HOURS: double = 50 -wage : double -hours : double -category : string +Hourly() +Hourly(in wage : double, in hours : double, in category : string) +Hourly(in fname : string, in lname : string, in gen : char, in dep : int, in wage : double, in hours : double, in ben : Benefit, in category : string) +CalculatePay() : double +displayEmployee() : void

STEP 2: Create the Project

Create a new project and name it CIS247C_WK5_Lab_LASTNAME. Copy all the source files from the Week 4 project into the Week 5 project.

Before you move on to the next step, build and execute the Week 5 project.

STEP 3: Modify the Employee Class

Using the updated Employee class diagram, modify the attributes to be protected.

Delete the iEmployee interface class, and remove the reference from the Employee class.

STEP 4: Create the Salaried Class

Using the UML Diagrams from Step 1, create the Salaried classes, ensuring to specify that the Salary class inherits from the Employee class.

For each of the constructors listed in the Salaried class, ensure to invoke the appropriate base class constructor and pass the correct arguments to the base class constructor. This will initialize the protected attributes and update the numEmployees counter.

The valid management levels are 0, 1, 2, and 3, and should be implemented as a constant.

Override the calculatePay method to add a 10 percent bonus for each of the management levels (i.e., bonus percentage = managementLevel * .10). The bonus percentage should be implemented as a constant.

Override the displayEmployee() method to add the management level to the employee information.

STEP 5: Label Title  

Using the UML Diagrams from Step 1, create the Hourly classes, ensuring to specify that the Hourly class inherits from the Employee class.

For each of the constructors listed in the Hourly class, ensure to invoke the appropriate base class constructor and pass the correct arguments to the base class constructor. This will initialize the protected attributes and update the numEmployees counter.

The valid category types are "temporary", "part time", and "full time".

The provided hours must be more than 0 hours and less than 50 hours, and the limits should be implemented as constants.

The provided wage must be between 10 and 75, and the limits should be implemented as constants.

Override the calculatePay method by multiplying the wages by the number of hours.

Override the Employee setAnnualSalary method and set the annual salary by multiplying the weekly pay by 50.

Override the displayEmployee() method to add the category to the hourly employee information.

STEP 6: Label Title

Using previous weeks' assignments as an example, create at least one Employee, Hourly, and Salaried employee.

For each object created, display the number of employees created.

For each object created, write statements to exercise each of the public methods listed in the Class diagram.

For each object created, invoke the object's displayEmployee() method to display the employee's information.

For employee, the following information needs to be displayed:

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.

Below is the complete sample program output for your reference.

Screenshot of program output that reads:

************** Employee 1 **************

Please enter your First Name Nana

Please enter your Last Name Liu

Please enter your Gender F

Please enter your Dependents 2

Please enter your Annual Salary 60000

Please enter your HealthInsurance PPO

Please enter your LifeInsurance 1.5

Please enter your Vacation Days 20

_____________________Employee Information _________________________

First Name: Nana

Last Name: Liu

Gender: F

Annual Salary: 60000.00

Weekly Salary: 1153.85

_____________________ Benefit Information ___________________

Health Insurance: PPO

Life Insurance: 1.50

Vacation: 20 days

Number of employees: 1

************** Employee 2 **************

Please enter your First Name Jackie

Please enter your Last Name Chan

Please enter your Gender M

Please enter your Dependents 1

Please enter your HealthInsurance HMO

Please enter your LifeInsurance 100

Please enter your Vacation Days 16

_____________________Employee Information _________________________

First Name: Jackie

Last Name: Chan

Gender: M

Dependents: 1

Annual Salary: 50000.00

Weekly Salary: 1250.00

_____________________ Benefit Information ___________________

Health Insurance: HMO

Life Insurance: 100.00

Vacation: 16 days

Salaried Employee Management Level: 3

Number of employees: 2

*************** Employee 3 ***************

Please enter your First Name James

Please enter your Last Name Bond

Please enter your Gender M

Please enter your Dependents 0

Please enter your Health Insurance PPO

Please enter your Life Insurance 120

Please enter your Vacation Days 17

_____________________Employee Information _________________________

First Name: James

Last Name: Bond

Gender: M

Dependents: 0

Annual Salary: 100000.00

Weekly Salary: 2000.00

_____________________ Benefit Information ___________________

 

Health Insurance: PPO

Life Insurance: 5.00

Vacation: 17

Employee Category: Unknown

Wage: 40.00

Hours: 50.00

Number of employees: 3

The end of the CIS247C Week 5 iLab.

Press any key to continue…
STEP 7: Label Title

• Capture the Console output window and paste into a Word document.
• Put the zip file and screenshots (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 these Step-by-Step Instructions or watch this Dropbox Tutorial.
See Syllabus “Due Dates for Assignments & Exams” for due date information.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

iLab 6 of 7 – Abstract Class and Polymorphism

We are going to create an abstract Employee class and two pure virtual functions - calculatePay() and displayEmployee(). The abstract Employee class will prevent a programmer from creating an object based on Employee, however, a pointer can still be created. Objects based on Salaried and Hourly will be allowed. The pure virtual function calculatePay() in Employee will force the child classes to implement calculatePay(). The other pure virtual function displayEmployee() in Employee will force the child classes to implement displayEmployee().

We are going to implement Polymorphism and dynamic binding in this iLab.

Deliverables

Due this week:

  • Capture the Console output window and paste it into a Word document.
  • Zip the project folder in the Microsoft Visual Studio.
  • Put the zip file and screenshots (word document) in the Dropbox.
 

i L A B  S T E P S

 

STEP 1: Understand the UML Diagram

 

Notice in the updated UML diagram that the Employee class is designated as abstract by having the class name Employee italicized. Also, the calculatePay method is italicized, which means that it is a pure virtual function and needs to be implemented in the derived classes. In addition, make displayEmployee() method a pure virtual function as well.

STEP 2: Create the Project

 

Create a new project and name it CIS247C_WK6_Lab_LASTNAME. Copy all the source files from the Week 5 project into the Week 6 project.

Before you move on to the next step, build and execute the Week 6 project.

STEP 3: Modify the Employee Class

 
  1. Define calculatePay() as a pure virtual function.
  2. Define displayEmployee() as a pure virtual function.
  3. When class Employee contains two pure virtual functions, it becomes an abstract class.

STEP 4: Create Generalized Input Methods

 

Reuse method getInput() from the previous iLab to prompt the user to enter Employee information.

STEP 5: Modify the Main Method

 

Create two employee pointers with:

Employee *employeeList1 = new Salaried(10000,3); Employee *employeeList2 = new Hourly(50, 40, "full time");

The first employee pointer refers to a salaried employee and the second employee pointer refers to a hourly employee.

Prompt the user to enter information for these two pointers and display the calculated result.

STEP 6: 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.
Below is a complete sample program output for your reference.

STEP 7: Submit Deliverables

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.

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

iLab 7 of 7: Code Management and Modularity

i L A B O V E R V I E W
Scenario and Summary

This week, we learn how to manage complexity by putting together a ready-built application that comprises a number of separate header and source files. Our job here will be to take these individual files and combine them into one standalone application. Although the process is quite a simple one, it will emphasize the advantage of modularity when writing code. It also shows how code can be reused between programmers and/or applications.
Deliverables
Due this week:
• Capture the Console output window and paste it into a Word document.
• Zip the project folder in Microsoft Visual Studio.
• Put the zip file and screen shots (Word document) in the Dropbox.
i L A B S T E P S
Overvi

Complete solution for CIS247 course in C++

It is 100% correct solution

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