Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

--------------------------EmployeeRecord.h Below------------------------------------------------------------------------------------------ #ifndef EMPLOYEERECORD_H #define EMPLOYEERECORD_H class EmployeeRecord { private: int m_iEmployeeID; char m_sFirstName[32]; char m_sLastName[32]; int m_iDeptID; double m_dSalary; public: EmployeeRecord(); //Constructor EmployeeRecord(int ID,

image text in transcribed

--------------------------EmployeeRecord.h Below------------------------------------------------------------------------------------------

#ifndef EMPLOYEERECORD_H #define EMPLOYEERECORD_H

class EmployeeRecord { private: int m_iEmployeeID; char m_sFirstName[32]; char m_sLastName[32]; int m_iDeptID; double m_dSalary;

public: EmployeeRecord(); //Constructor EmployeeRecord(int ID, char *fName, char *lName, int dept, double sal); //Setting the values. ~EmployeeRecord(); //Destructor int getID(); // Return the value stored in the member variable void setID(int ID); void getName(char *fName, char *lName); void setName(char *fName, char *lName); void getDept(int& d); void setDept(int d); void getSalary(double *sal);//Define Pointer Function void setSalary(double sal);//Copy the function argument to m_dSalary. void printRecord(); //Print to screen

}; #endif

---------------------------------------------------------------------EmployeeRecord.Cpp Below------------------------------------------------------------------------ #include #include "EmployeeRecord.h" #include #include #include #include #include

using namespace std;

EmployeeRecord::EmployeeRecord() {

//Set Values m_iEmployeeID = 0; m_sFirstName[0] = '\0'; m_sLastName[0] = '\0'; m_iDeptID = 0; m_dSalary = 0.0; }

EmployeeRecord::EmployeeRecord(int ID, char *fName, char *lName, int dept, double sal) { //Problem 1 m_iEmployeeID = ID; strcpy(m_sFirstName, fName); strcpy(m_sLastName, lName); m_iDeptID = dept; m_dSalary = sal; }

//Destructor

EmployeeRecord::~EmployeeRecord() {

}

int EmployeeRecord::getID() { return m_iEmployeeID; }

void EmployeeRecord::setID(int ID) { m_iEmployeeID = ID; }

void EmployeeRecord::getName(char *fName, char *lName) { //Problem 2 strcpy(fName, m_sFirstName); strcpy(lName, m_sLastName);

}

void EmployeeRecord::setName(char *fName, char *lName) {

strcpy(m_sFirstName, fName); strcpy(m_sLastName, lName);

} void EmployeeRecord::getDept(int& d) { d = m_iDeptID; }

void EmployeeRecord::setDept(int d) { m_iDeptID = d; }

void EmployeeRecord::getSalary(double *sal) { *sal = m_dSalary; }

void EmployeeRecord::setSalary(double sal) { m_dSalary = sal; }

void EmployeeRecord::printRecord() { cout

2.0.1 This software system shall consist of three source files (.cpp) and three header files (.h) defining three classes. The first class, which was developed in phase one is the EmployeeRecord class. It will be modified to hold a list of stores served by an employee. The second class, which shall be called Store shall be used to store information on a single customer store. The third class, which shall be called CustomerList shall define and maintain an ordered linked list of instances of the class Store.
2.0.2 The class EmployeeRecord, which was defined in Phase 1 shall be modified in order to maintain a list of stores served by the employee.
2.0.2.1 A pointer to a class of type CustomerList called m_pCustomerList shall be added to the EmployeeRecord class.
2.0.2.2 The constructors of the EmployeeRecord class shall be modified so that each creates an instance of a CustomerList object and sets the pointer m_pCustomerList pointing to this object. The destructor of the EmployeeRecord class shall be modified to delete this instance of CustomerList.
2.0.2.3 The function CustomerList *getCustomerList() shall be added to the EmployeeRecord class. This function shall return the pointer to the EmployeeRecord's CustomerList object.
2.0.2.4 The function getDept() shall be modified to take no arguments but return the int value of m_iDeptID.
2.0.2.5 The function getSalary() shall be modified to take no arguments but return the double value of m_dSalary.
2.0.3 The class Store shall maintain information on a single customer store for the employee. This class shall hold the store ID number, name, address, city, state, and zip code. It will contain get and set functions for each of these items. It will also contain a pointer called m_pNext which will enable a linked list of Store objects to be created and maintained by the class CustomerList. The header file and the implementation file for this class will be provided by the instructor.
2.0.4 The class CustomerList shall create and maintain an ordered linked list of Store objects arranged by Store ID.
2.0.4.1 The CustomerList class shall contain the following private variable: Store *m_pHead which shall point to the first Store instance in the list.
2.0.4.2 The CustomerList class shall contain the following public functions: bool addStore(Store *s), Store *removeStore(int ID), Store *getStore(int ID), bool updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip), and void printStoresInfo().
2.0.4.2.1 bool addStore(Store *s)--This function shall take a pointer to a Store object which already contains all data on a store. It shall insert the Store object into the linked list in order, sorted by the store ID. It shall return TRUE if the Store was successfully added to the list.
2.0.4.2.2 Store *removeStore(int ID)--This function shall take an integer store ID as an argument. It shall search the list, locate the Store object with that ID if one is present, remove it from the list and return the Store object. The function shall return NULL if it failed to find the Store in the list.
2.0.4.2.3 Store *getStore(int ID)--This function shall take an integer store ID. It shall search the list, locate the Store object, if present, and return a pointer to the Store object. It shall return NULL if the Store was not found in the list.
2.0.4.2.4 bool updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip)--Function shall take a list of arguments defining changes in the store data. The first argument gives the store ID. The function will search the list and locate the store then update all data for that store. The function will return TRUE if it successfully updated the data or FALSE if it failed to find the store.
2.0.4.2.5 void printStoresInfo()--Function shall print all data on each store in the list. I am looking for some help with this. I was able to complete Assignment 1, and assignment 2 builds onto assignment 1.
Customer List h ustomerList.cpp Store h Employee Record. h X EmployeeRecord.cpp Store cpp EmployeeRecord R ProgrammingAssignment1 1 Eg/******************************************************************* 2 Employee Record h Programming Assignment 1 6 This program is entirely my own work 9 #ifndef EMPLOYEERECORD H 10 #define EMPLOYEERECORD H 13 Eclass EmployeeRecord private: int ma iEmployeeID char m Firs 321 tName 18 char m LastName[32]; int m iDeptID 19 20 double m dsalary; 22 public Employee Record Constructor Employee Record(int ID char Name char *lName, int dept double sal); //Setting the values ~Employee Record //Destructor int getID(); Return the value stored in the member variable void set (int ID void getName (char *fName, char IName void setName (char *fName, char IName 29 void getDept (int& d) void setDept(int d) 31 void get Salary (double sal Pointer Function void setsalary (double sal the function argument to m dsalary. void printRecord(); //Print to screen 35 36 37 #endif

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Programming Languages 12th International Symposium Dbpl 2009 Lyon France August 2009 Proceedings Lncs 5708

Authors: Philippa Gardner ,Floris Geerts

2009th Edition

3642037925, 978-3642037924

More Books

Students also viewed these Databases questions

Question

Who was the first woman prime minister of india?

Answered: 1 week ago

Question

Explain the concept of going concern value in detail.

Answered: 1 week ago

Question

Define marketing.

Answered: 1 week ago

Question

What are the traditional marketing concepts? Explain.

Answered: 1 week ago