MCC - Marquez - CIS162AB - C++ Level I
P10 SalesPerson Class Interface - 10 points
(submit source code)
   cpp.gif

The purpose of this project is to familiarize the student with defining classes from a Uniform Modeling Language (UML) Class Diagram. In prior assignments we saw how structure charts could be used to design a modular program using the top-down design methodology and how flowcharts could be used to depict the detail logic of a specific module. To design an object-oriented program, we can also use symbolic notation. There are a few modeling languages to choose from, but UML has quickly become a de-facto standard.

The only thing required for this assignment is the class definition and an empty main function which is required by the compiler. The class definition created here will then be used to complete P11 SalesPerson Implementation.

UML - Class Diagram:
Symbol definitions:
- private
+ public
# protected

SalesPerson
- int salesPersonId
- string firstName
- string lastName
+ SalesPerson ( ) //default constructor doesn't have parameters
+ SalesPerson(int id, string fn, string ln) //overloaded constructor;
//parameter names in overloaded constructors should be different
//from the class variable names, because the parameter values
//are going to be assigned to the class variables.

+ ~SalesPerson ( ) //destructor

//Set accessors do NOT return a value (void) because they are used
//to assign a value to a private variable. The value to assign is
//passed through the parameter.
+ void setSalesPersonId(int id)
+ void setFirstName(string fn)
+ void setLastName(string ln)

//Get accessors are used to return the value stored in a private
//variable, so a parameter is not passed.
+ int getSalesPersonId( )
+ string getFirstName( )
+ string getLastName( )

//Input accessors prompt for, get, and store a value in a private
//variable. A value is not returned and a parameter is not passed.
+ void inputSalesPersonId( )
+ void inputFirstName( )
+ void inputLastName( )



Create project P10
Add a C++ Source file named P10.cpp
  Enter your class definition for SalesPerson
  Make sure there aren't any syntax errors in the class definition.
  An empty main function will need to be added so the project will compile.
 










Sample Source Code:


//P10 SalesPerson class - Juan Marquez  

#include <string>   // string class
using namespace std;


//Class definition -  the interface for the class

class SalesPerson
{
private:



public:





};

//Need empty main so program will compile 
void main()
{
    return;
}



Revised: 11/09/2009 - www.mc.maricopa.edu/~marquez/cis162ab/p10_sales_class.html