Uml diagram of all the classes

Assignment Help C/C++ Programming
Reference no: EM131283

Objective

In this assignment, you read a list of employees from a CSV file and convert them into corresponding objects. Note that, unlike Lab 4, the CSV file contains more than one type of Employee. In addition to a StudentEmployee, we also have ClassifiedStaff and Faculty that extend our base Employee. Each employee has different information (described more in the UML diagram). Let's take a look at the CSV as it appears in Excel (note: color added to distinguish between Employee types):

52_Untitled.png

In green, we have StudentEmployees. In red are examples of ClassifiedStaff. Finally, the blue contains Faculty. Note the subtle differences between each Employee type. ClassifiedStaff have one less column. StudentEmployee's last column contains a double whereas Faculty's last column contains a string. You will need to use these differences when converting from CSV into the appropriate object-type.

Obtaining the Correct Object-type

Speaking of converting into the correct object-type, this assignment also introduces you to the classic design pattern known as the Factory. The goal of the factory is to abstract away object creation. Doing so allows us to create more generic code that can be used in a wider variety of circumstances. In our situation, our factory will accept a line from the CSV, convert that line into a pointer of the appropriate class (StudentEmployee, ClassifiedStaff, or Faculty), and return that instance of that class back to the main function.

UML Diagram

2285_Untitled.png

Here's a complete UML diagram of all the classes that you'll need to create:
Employee and its Derivatives
Most of the Employee and its derivative class' methods should be self-explanatory as they're mostly just basic getters and setters. However, I will comment on the class constructors and the two virtual function.
Class Constructors
In order to promote code reuse, derivatives of Employee should call Employee's base constructor. We've talked about how to do this in class, but here's a basic example:
StudentEmployee( <paramters here>)
: Employee( <pass parameters to employee> )
{
//initialize variables specific to StudentEmployee here.
}
The getWeeklyPay Method
the getWeeklyPay() method is calculated differently based on the derived class:
? For StudentEmployees, you get the weekly pay by multiplying their hours worked by their hourly wage
? For ClassifiedStaff, simply return the weekly salary
? For Faculty, return their yearly wage divided by the number of weeks that they work
The toString Method
Like reusing the base class' constructor, you should also aim to reuse the base class' toString() method. To do so, simply call Employee::toString() in your overridden method. The format for each toString() is shown in the sample output section.

Sample Output
Below is sample output from my program:

2491_Untitled.png

Note that only people presently working are displayed in the "Next Paycheck" area. In my case, Ezra Brooks isn't working so he isn't displayed in the paycheck section.
Header Comment, and Formatting
1. Be sure to modify the file header comment at the top of your script to indicate your name, student ID, completion time, and the names of any individuals that you collaborated with on the assignment.
2. Remember to follow the basic coding style guide. A basic list of rules can be found on OSBLE.

Reference no: EM131283

Questions Cloud

Rc circuits: capacitor is completely discharged : Assume that capacitor is completely discharged when t
Explain the difference in a technical performance measure : good understanding of Mil-Std-499 and Mil-Std-499A
Prepare a project summary : Overview of the project's objectives and scope
Design a bridge : Design a bridge that will withstand 4 fully loaded semi-trailers
Uml diagram of all the classes : Speaking of converting into the correct object-type, the goal of the factory is to abstract away object creation.
Explain flow boundaries map : Explain flow boundaries map the dfd into a software architecture using transform mapping.
Prepare a presentation on best members club : Prepare a presentation on best members club
Differences between common law and equity : Write an essay critically discussing the differences between common law and equity.
Different applications of data structure : What are the different applications of Data Structure

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Design a nested program

How many levels of nesting are there in this design?

  Loops and if conditions

Write a program that requests a password

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Write a program to read a data file and extract parameters

Write a C/C++ program to read a data file and extract parameters. The program must obtain the filename via a command-line argument.

  C++ programming uml diagrams

The goal of this lab is to better familiarize you with polymorphism and the factory design pattern, two key components in Assignment

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write two short c programs and solve exam-style problem

Write two short C programs and solve four exam-style problems.

  Iterative programming problem solving approaches

Write a recursive function void reverse ( ) that reverse a sentence

  Time conversion

Write a C++ program that takes an Eastern standard time in hours, minutes, and seconds,and prints it out in Central time, Mountain time, or Pacific time.

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Write a webservices application

Write a webservices application that does a simple four function calculator

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd