-
Notifications
You must be signed in to change notification settings - Fork 0
/
ShipTypeLookUp.cpp
39 lines (37 loc) · 905 Bytes
/
ShipTypeLookUp.cpp
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
#include <iostream>
#include <string>
#include <boost/algorithm/string.hpp>
#include "ship_list.hpp"
int main()
{
bool keepGoing = true;
while(keepGoing)
{
std::string inp;
std::cout << "Enter the Short Name for the ship type (enter Q to quit)> ";
std::cin >> inp;
boost::to_upper(inp);
if(inp.compare("Q") == 0)
{
keepGoing = false;
}
else
{
size_t i;
for(i = 0; i < shortNames.size(); i++)
{
if(inp.compare(shortNames[i]) == 0)
{
std::cout << fullNames[i] << "\n\n";
break;
}
}
if(i >= shortNames.size())
{
std::cout << "Not Found\n";
}
}
}
std::cout << "Bye Bye" << std::endl;
return 0;
}