1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
|
//
// Work Flow Assistant Program
//
#include <iostream>
#include <algorithm>
#include <cctype>
#include <iostream>
#include <map>
#include <stdexcept>
#include <string>
using namespace std;
int main()
// Get the Time Zone of the ticket
{
int get_TIMEZONE(std::string in)
{
static const std::map<std::string, int> TIMEZONE
{
{ "PST", 101 },{ "MST", 102 },{ "CST", 103 },{ "EST", 104 }
};
std::transform(in.begin(), in.end(), in.begin(), ::tolower);
{
auto it = timezone.find(in);
if (it != timezone.end())
return it->second;
}
if (all_of(in.begin(), in.end(), ::isdigit))
return std::stoi(in);
throw std::invalid_argument("Bad Time Zone string");
}
//Get the ticket type
int get_tickettype(std::string in)
{
static const std::map<std::string, int> ticketype
{
{ "General", 1 },{ "HandsOn", 2 }
};
std::transform(in.begin(), in.end(), in.begin(), ::tolower);
{
auto it = tickettype.find(in);
if (it != tickettype.end())
return it->second;
}
if (all_of(in.begin(), in.end(), ::isdigit))
return std::stoi(in);
throw std::invalid_argument("Bad Ticket Type string");
}
//
// Start of acutal processes
//
{
cout << "----------Work Flow Assistant v0.7----------" << endl << endl;
try
{
std::string temp;
std::cout << "Please enter the time zone (PST, MST, CST, EST):\n";
std::cin >> temp;
int ou = get_timezone(std::move(temp));
std::cout << "\nPlease enter the type of ticket (General, HandsOn:\n";
std::cin >> temp;
int area = get_tickettype(std::move(temp));
std::cout << "\n\n";
//Loop to get desired tech assigned
if (get_timezone == 101 && get_tickettype == 1)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
else if (get_timezone == 102 && get_tickettype == 1)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
else if (get_timezone == 103 && get_tickettype == 1)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
else if (get_timezone == 104 && get_tickettype == 1)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
else if (get_timezone == 101 && get_tickettype == 2)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
else if (get_timezone == 102 && get_tickettype == 2)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
else if (get_timezone == 103 && get_tickettype == 2)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
else if (get_timezone == 104 && get_tickettype == 2)
{
std::cout << "Your tech is tech1 or tech2.\n";
}
}
catch (std::exception& e)
{
std::cerr << e.what();
return EXIT_FAILURE;
}
system("pause");
return 0;
}
//End of program
|