added old projects
This commit is contained in:
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,300 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 55;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
D9284AC62878203F00E2460C /* laborer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284AC02878203F00E2460C /* laborer.cpp */; };
|
||||
D9284AC72878203F00E2460C /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284AC12878203F00E2460C /* main.cpp */; };
|
||||
D9284AC82878203F00E2460C /* manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284AC22878203F00E2460C /* manager.cpp */; };
|
||||
D9284AC92878203F00E2460C /* owner.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284AC32878203F00E2460C /* owner.cpp */; };
|
||||
D9284ACA2878203F00E2460C /* person.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D9284AC52878203F00E2460C /* person.cpp */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXCopyFilesBuildPhase section */
|
||||
D9284A8F2877EF2700E2460C /* CopyFiles */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = /usr/share/man/man1/;
|
||||
dstSubfolderSpec = 0;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 1;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
D9284A912877EF2700E2460C /* Business */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = Business; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
D9284AC02878203F00E2460C /* laborer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = laborer.cpp; sourceTree = "<group>"; };
|
||||
D9284AC12878203F00E2460C /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
||||
D9284AC22878203F00E2460C /* manager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = manager.cpp; sourceTree = "<group>"; };
|
||||
D9284AC32878203F00E2460C /* owner.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = owner.cpp; sourceTree = "<group>"; };
|
||||
D9284AC42878203F00E2460C /* input.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = input.h; sourceTree = "<group>"; };
|
||||
D9284AC52878203F00E2460C /* person.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = person.cpp; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
D9284A8E2877EF2700E2460C /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
D9284A882877EF2700E2460C = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D9284A932877EF2700E2460C /* Business */,
|
||||
D9284A922877EF2700E2460C /* Products */,
|
||||
);
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D9284A922877EF2700E2460C /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D9284A912877EF2700E2460C /* Business */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
D9284A932877EF2700E2460C /* Business */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
D9284AC42878203F00E2460C /* input.h */,
|
||||
D9284AC02878203F00E2460C /* laborer.cpp */,
|
||||
D9284AC12878203F00E2460C /* main.cpp */,
|
||||
D9284AC22878203F00E2460C /* manager.cpp */,
|
||||
D9284AC32878203F00E2460C /* owner.cpp */,
|
||||
D9284AC52878203F00E2460C /* person.cpp */,
|
||||
);
|
||||
path = Business;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
D9284A902877EF2700E2460C /* Business */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = D9284A982877EF2700E2460C /* Build configuration list for PBXNativeTarget "Business" */;
|
||||
buildPhases = (
|
||||
D9284A8D2877EF2700E2460C /* Sources */,
|
||||
D9284A8E2877EF2700E2460C /* Frameworks */,
|
||||
D9284A8F2877EF2700E2460C /* CopyFiles */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Business;
|
||||
productName = Business;
|
||||
productReference = D9284A912877EF2700E2460C /* Business */;
|
||||
productType = "com.apple.product-type.tool";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
D9284A892877EF2700E2460C /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
BuildIndependentTargetsInParallel = 1;
|
||||
LastUpgradeCheck = 1340;
|
||||
TargetAttributes = {
|
||||
D9284A902877EF2700E2460C = {
|
||||
CreatedOnToolsVersion = 13.4.1;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = D9284A8C2877EF2700E2460C /* Build configuration list for PBXProject "Business" */;
|
||||
compatibilityVersion = "Xcode 13.0";
|
||||
developmentRegion = en;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
Base,
|
||||
);
|
||||
mainGroup = D9284A882877EF2700E2460C;
|
||||
productRefGroup = D9284A922877EF2700E2460C /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
D9284A902877EF2700E2460C /* Business */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
D9284A8D2877EF2700E2460C /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
D9284AC72878203F00E2460C /* main.cpp in Sources */,
|
||||
D9284AC92878203F00E2460C /* owner.cpp in Sources */,
|
||||
D9284AC82878203F00E2460C /* manager.cpp in Sources */,
|
||||
D9284AC62878203F00E2460C /* laborer.cpp in Sources */,
|
||||
D9284ACA2878203F00E2460C /* person.cpp in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
D9284A962877EF2700E2460C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
ENABLE_TESTABILITY = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.3;
|
||||
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
|
||||
MTL_FAST_MATH = YES;
|
||||
ONLY_ACTIVE_ARCH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
D9284A972877EF2700E2460C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
CLANG_ANALYZER_NONNULL = YES;
|
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_ENABLE_OBJC_WEAK = YES;
|
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||
CLANG_WARN_COMMA = YES;
|
||||
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
|
||||
CLANG_WARN_EMPTY_BODY = YES;
|
||||
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||
CLANG_WARN_INT_CONVERSION = YES;
|
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
|
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
|
||||
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||
COPY_PHASE_STRIP = NO;
|
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||
ENABLE_NS_ASSERTIONS = NO;
|
||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu11;
|
||||
GCC_NO_COMMON_BLOCKS = YES;
|
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
MACOSX_DEPLOYMENT_TARGET = 12.3;
|
||||
MTL_ENABLE_DEBUG_INFO = NO;
|
||||
MTL_FAST_MATH = YES;
|
||||
SDKROOT = macosx;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
D9284A992877EF2700E2460C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = N3GD25M5J3;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
D9284A9A2877EF2700E2460C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
DEVELOPMENT_TEAM = N3GD25M5J3;
|
||||
ENABLE_HARDENED_RUNTIME = YES;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
D9284A8C2877EF2700E2460C /* Build configuration list for PBXProject "Business" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D9284A962877EF2700E2460C /* Debug */,
|
||||
D9284A972877EF2700E2460C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
D9284A982877EF2700E2460C /* Build configuration list for PBXNativeTarget "Business" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
D9284A992877EF2700E2460C /* Debug */,
|
||||
D9284A9A2877EF2700E2460C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = D9284A892877EF2700E2460C /* Project object */;
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Workspace
|
||||
version = "1.0">
|
||||
<FileRef
|
||||
location = "self:">
|
||||
</FileRef>
|
||||
</Workspace>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IDEDidComputeMac32BitWarning</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</plist>
|
||||
BIN
Binary file not shown.
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Bucket
|
||||
uuid = "07C5E0D7-E0E2-49AA-944E-B93BA4DD2C20"
|
||||
type = "1"
|
||||
version = "2.0">
|
||||
</Bucket>
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>SchemeUserState</key>
|
||||
<dict>
|
||||
<key>Business.xcscheme_^#shared#^_</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"files.associations": {
|
||||
"iosfwd": "cpp",
|
||||
"typeinfo": "cpp",
|
||||
"vector": "cpp",
|
||||
"string": "cpp"
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"tasks": [
|
||||
{
|
||||
"type": "cppbuild",
|
||||
"label": "C/C++: g++ build active file",
|
||||
"command": "/usr/bin/g++",
|
||||
"args": [
|
||||
"-fdiagnostics-color=always",
|
||||
"-g",
|
||||
"${file}",
|
||||
"-o",
|
||||
"${fileDirname}/${fileBasenameNoExtension}"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${fileDirname}"
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
],
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"detail": "Task generated by Debugger."
|
||||
}
|
||||
],
|
||||
"version": "2.0.0"
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Header file for ReadValue
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <climits>
|
||||
#include <string>
|
||||
|
||||
template<typename inputType>
|
||||
inputType ReadValue(std::string prompt)
|
||||
{
|
||||
inputType returnValue=0;
|
||||
std::cout << prompt;
|
||||
std::cin >> returnValue;
|
||||
while (std::cin.fail()) {
|
||||
std::cout << "Error! Cannot read input.\n";
|
||||
std::cin.clear();
|
||||
std::cin.ignore(INT_MAX,'\n');
|
||||
std::cout << prompt;
|
||||
std::cin >> returnValue;
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
template<typename inputType>
|
||||
inputType ReadValue(std::string prompt, inputType minValue)
|
||||
{
|
||||
inputType returnValue=0;
|
||||
returnValue=ReadValue<inputType>(prompt);
|
||||
while (returnValue < minValue) {
|
||||
std::cout << "Error! Value must be >= " << minValue << std::endl;
|
||||
returnValue=ReadValue<inputType>(prompt);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
|
||||
template<typename inputType>
|
||||
inputType ReadValue(std::string prompt, inputType minValue, inputType maxValue)
|
||||
{
|
||||
inputType returnValue=0;
|
||||
returnValue=ReadValue<inputType>(prompt,minValue);
|
||||
while (returnValue > maxValue) {
|
||||
std::cout << "Error! Value must be <= " << maxValue << std::endl;
|
||||
returnValue=ReadValue<inputType>(prompt,minValue);
|
||||
}
|
||||
return returnValue;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#include "person.cpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Laborer : public Person
|
||||
{
|
||||
protected:
|
||||
string _job;
|
||||
string _laborerEmployeeID;
|
||||
string _hourlySalary;
|
||||
string _hoursWorked;
|
||||
|
||||
public:
|
||||
Laborer(string laborerName, string laborerBirthday, string laborerSSN, string job, string employeeID, string hourlySalary, string hoursWorked) : Person(laborerName, laborerBirthday, laborerSSN)
|
||||
{
|
||||
_job = job;
|
||||
_laborerEmployeeID = employeeID;
|
||||
_hourlySalary = hourlySalary;
|
||||
_hoursWorked = hoursWorked;
|
||||
}
|
||||
|
||||
// Accessors
|
||||
string getJob() { return _job; };
|
||||
string getEmployeeID() { return _laborerEmployeeID; };
|
||||
string getHourlySalary() { return _hourlySalary; };
|
||||
string getHoursWorked() { return _hoursWorked; };
|
||||
string getType() { return "Laborer"; }
|
||||
|
||||
// Mutators
|
||||
void setJob(string job) { _job = job; };
|
||||
void setEmployeeID(string employeeID) { _laborerEmployeeID = employeeID; };
|
||||
void setHourlySalary(string hourlySalary) { _hourlySalary = hourlySalary; };
|
||||
void setHoursWorked(string hoursWorked) { _hoursWorked = hoursWorked; };
|
||||
|
||||
void Display() {
|
||||
cout << endl;
|
||||
cout << getType() << ":" << endl;
|
||||
cout << " " << getName() << " " << getBirthday() << " " << getSSN() << " " << getJob() << " " << getEmployeeID() << " " << getHourlySalary() << " " << getHoursWorked() << endl;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,233 @@
|
||||
//
|
||||
// main.cpp
|
||||
// Business
|
||||
//
|
||||
// Created by Austin Bennett on 7/7/22.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
#include "person.cpp"
|
||||
#include "laborer.cpp"
|
||||
#include "manager.cpp"
|
||||
#include "owner.cpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
vector<Person *> list;
|
||||
|
||||
void DisplayAddMenu()
|
||||
{
|
||||
int choice;
|
||||
do
|
||||
{
|
||||
cout << endl
|
||||
<< " 1 - Add Laborer\n"
|
||||
<< " 2 - Add Manager\n"
|
||||
<< " 3 - Add Owner\n"
|
||||
<< " 4 - Exit.\n"
|
||||
<< " Enter your choice and press return: ";
|
||||
cin >> choice;
|
||||
cout << endl;
|
||||
|
||||
if (choice == 1)
|
||||
{
|
||||
cout << "Name: ";
|
||||
string name;
|
||||
cin.ignore();
|
||||
getline(cin, name);
|
||||
|
||||
cout << "Birthday: ";
|
||||
string birthday;
|
||||
getline(cin, birthday);
|
||||
|
||||
cout << "SSN: ";
|
||||
string ssn;
|
||||
getline(cin, ssn);
|
||||
|
||||
cout << "Job: ";
|
||||
string job;
|
||||
getline(cin, job);
|
||||
|
||||
cout << "Employee ID: ";
|
||||
|
||||
string laborerEmployeeID;
|
||||
getline(cin, laborerEmployeeID);
|
||||
|
||||
cout << "Hourly Salary: ";
|
||||
string hourlySalary;
|
||||
getline(cin, hourlySalary);
|
||||
|
||||
cout << "Hours Worked: ";
|
||||
string hoursWorked;
|
||||
getline(cin, hoursWorked);
|
||||
|
||||
list.push_back(new Laborer(name, birthday, ssn, job, laborerEmployeeID, hourlySalary, hoursWorked));
|
||||
}
|
||||
else if (choice == 2)
|
||||
{
|
||||
cout << "Name: ";
|
||||
string name;
|
||||
cin.ignore();
|
||||
getline(cin, name);
|
||||
|
||||
cout << "Birthday: ";
|
||||
string birthday;
|
||||
getline(cin, birthday);
|
||||
|
||||
cout << "SSN: ";
|
||||
string ssn;
|
||||
getline(cin, ssn);
|
||||
|
||||
cout << "Department: ";
|
||||
string department;
|
||||
getline(cin, department);
|
||||
|
||||
cout << "Employee ID: ";
|
||||
string managerEmployeeID;
|
||||
getline(cin, managerEmployeeID);
|
||||
|
||||
cout << "Salary: ";
|
||||
string salary;
|
||||
getline(cin, salary);
|
||||
|
||||
list.push_back(new Manager(name, birthday, ssn, department, managerEmployeeID, salary));
|
||||
}
|
||||
else if (choice == 3)
|
||||
{
|
||||
cout << "Name: ";
|
||||
string name;
|
||||
cin.ignore();
|
||||
getline(cin, name);
|
||||
|
||||
cout << "Birthday: ";
|
||||
string birthday;
|
||||
getline(cin, birthday);
|
||||
|
||||
cout << "SSN: ";
|
||||
string ssn;
|
||||
getline(cin, ssn);
|
||||
|
||||
cout << "Percent Owned: ";
|
||||
string percentOwned;
|
||||
getline(cin, percentOwned);
|
||||
|
||||
cout << "Owner Since: ";
|
||||
string ownerSince;
|
||||
getline(cin, ownerSince);
|
||||
|
||||
list.push_back(new Owner(name, birthday, ssn, percentOwned, ownerSince));
|
||||
}
|
||||
else if (choice == 4)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "Invalid Input\n";
|
||||
cin.clear();
|
||||
cin.ignore(10000, '\n');
|
||||
}
|
||||
} while (choice != 4);
|
||||
}
|
||||
|
||||
void DisplayListMenu()
|
||||
{
|
||||
int choice;
|
||||
do
|
||||
{
|
||||
cout << endl
|
||||
<< " 1 - View Laborers\n"
|
||||
<< " 2 - View Managers\n"
|
||||
<< " 3 - View Owners\n"
|
||||
<< " 4 - Exit.\n"
|
||||
<< " Enter your choice and press return: ";
|
||||
cin >> choice;
|
||||
cout << endl;
|
||||
|
||||
if (choice == 1)
|
||||
{
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
Person* person = list[i];
|
||||
cout << person -> getType();;
|
||||
string type = list[i]->getType();
|
||||
if (type == "Laborer")
|
||||
{
|
||||
list[i]->Display();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (choice == 2)
|
||||
{
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
Person *person = list[i];
|
||||
string type = person->getType();
|
||||
if (type == "Manager")
|
||||
{
|
||||
list[i]->Display();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (choice == 3)
|
||||
{
|
||||
for (int i = 0; i < list.size(); i++)
|
||||
{
|
||||
string type = list[i]->getType();
|
||||
if (type == "Owner")
|
||||
{
|
||||
list[i]->Display();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (choice == 4)
|
||||
{
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
cin.clear();
|
||||
cin.ignore(10000, '\n');
|
||||
}
|
||||
|
||||
} while (choice != 4);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
int choice;
|
||||
do
|
||||
{
|
||||
cout << endl
|
||||
<< " 1 - Add Person\n"
|
||||
<< " 2 - Display List\n"
|
||||
<< " 3 - Exit.\n"
|
||||
<< " Enter your choice and press return: ";
|
||||
cin >> choice;
|
||||
cout << endl;
|
||||
|
||||
if (choice == 1)
|
||||
{
|
||||
DisplayAddMenu();
|
||||
}
|
||||
else if (choice == 2)
|
||||
{
|
||||
DisplayListMenu();
|
||||
}
|
||||
else if (choice == 3)
|
||||
{
|
||||
cout << "End of Program.\n";
|
||||
cin.clear();
|
||||
cin.ignore(10000, '\n');
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "Not a Valid Choice. \nChoose again.\n";
|
||||
}
|
||||
} while (choice != 3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#include "person.cpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Manager : public Person
|
||||
{
|
||||
protected:
|
||||
string _department;
|
||||
string _managerEmployeeID;
|
||||
string _salary;
|
||||
|
||||
public:
|
||||
Manager(string managerName, string managerBirthday, string managerSSN, string department, string employeeID, string salary) : Person(managerName, managerBirthday, managerSSN)
|
||||
{
|
||||
_department = department;
|
||||
_managerEmployeeID = employeeID;
|
||||
_salary = salary;
|
||||
}
|
||||
|
||||
// Accessors
|
||||
string getDepartment() { return _department; };
|
||||
string getEmployeeID() { return _managerEmployeeID; };
|
||||
string getSalary() { return _salary; };
|
||||
string getType() { return "Manager"; };
|
||||
|
||||
// Mutators
|
||||
void setDepartment(string department) { _department = department; };
|
||||
void setEmployeeID(string employeeID) { _managerEmployeeID = employeeID; };
|
||||
void setSalary(string salary) { _salary = salary; };
|
||||
|
||||
void Display() {
|
||||
cout << endl;
|
||||
cout << getType() << ":" << endl;
|
||||
cout << " " << getName() << " " << getBirthday() << " " << getSSN() << " " << getDepartment() << " " << getEmployeeID() << " " << getSalary() << endl;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "person.cpp"
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Owner : public Person
|
||||
{
|
||||
protected:
|
||||
string _percentOwned;
|
||||
string _ownerSince;
|
||||
|
||||
public:
|
||||
Owner(string ownerName, string ownerBirthday, string ownerSSN, string percentOwned, string ownerSince) : Person(ownerName, ownerBirthday, ownerSSN)
|
||||
{
|
||||
_percentOwned = percentOwned;
|
||||
_ownerSince = ownerSince;
|
||||
}
|
||||
|
||||
// Accessors
|
||||
string getPercentOwned() { return _percentOwned; };
|
||||
string getOwnerSince() { return _ownerSince; };
|
||||
string getType() { return "Owner"; };
|
||||
|
||||
// Mutators
|
||||
void setPercentOwned(string percentOwned) { _percentOwned = percentOwned; };
|
||||
void setOwnerSince(string ownerSince) { _ownerSince = ownerSince; };
|
||||
|
||||
void Display() {
|
||||
cout << endl;
|
||||
cout << getType() << ":" << endl;
|
||||
cout << " " << getName() << " " << getBirthday() << " " << getSSN() << " " << getPercentOwned() << " " << getOwnerSince()<< endl;
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
#pragma once
|
||||
|
||||
using namespace std;
|
||||
|
||||
class Person
|
||||
{
|
||||
protected:
|
||||
string _name;
|
||||
string _birthday;
|
||||
string _ssn;
|
||||
|
||||
public:
|
||||
Person(string name, string birthday, string ssn)
|
||||
{
|
||||
_name = name;
|
||||
_birthday = birthday;
|
||||
_ssn = ssn;
|
||||
}
|
||||
|
||||
// Accessors
|
||||
string getName() { return _name; };
|
||||
string getBirthday() { return _birthday; };
|
||||
string getSSN() { return _ssn; };
|
||||
|
||||
|
||||
// Mutators
|
||||
void setName(string name) { _name = name; }
|
||||
void setBirthday(string birthday) { _birthday = birthday; };
|
||||
void setSSN(string ssn) { _ssn = ssn; };
|
||||
|
||||
virtual void Display() = 0;
|
||||
virtual string getType();
|
||||
};
|
||||
Reference in New Issue
Block a user