// Nathan Eloe 7 September 2013
// moPhone.cpp
// A phone number generater for Moe's phone service
#include <iostream>
#include <string>
using namespace std;
int main()
{
const int PNGF = 78; // The Phone Number Gender Factor (PNGF)
// Inputs
string fName, lName;
int eyeColor; // Wavelength
bool isFemale;
float height; // in meters, because we do metric!
// Output digits in format abc-def-ghij
int abc, hijk;
int digD, digE, digF;
int hgtXcol;
cout << "\t\tWelcome to Springfield's new MOEbile phone service!\n"
<< "Please fill out the following billing information:\n"
<< "[First Name]: ";
cin >> fName;
cout << " [Last Name]: ";
cin >> lName;
cout << "Thank you. Your choices for eye color are:\n"
<< "\t475 (Blue)\n\t510 (Green)\n\t590 (Orange)\n"
<< " [Eye Color]: ";
cin >> eyeColor;
cout << "Your gender choices are:\n"
<< "\t0 (Male)\n\t1 (Female)\n"
<< " [Gender]: ";
cin >> isFemale;
cout << "[Height (m)]: ";
cin >> height;
//First three digits
abc = eyeColor;
//Second 3, this is trickier
hgtXcol = static_cast<int>(height * eyeColor);
digD = (hgtXcol / 100) % 10;
digE = (hgtXcol / 10) % 10;
digF = hgtXcol % 10;
//And finally:
hijk = static_cast<int>(10 * eyeColor + PNGF * isFemale + height * height);
//And, the output
cout << endl << "\tCustomer Information" << endl;
cout << "Name:\t\t" << fName + " " + lName << endl;
cout << "Phone Number:\t(" << abc << ") " << digD << digE << digF
<< "-" << hijk << endl;
cout << "Our Motto:\tSpringfield MOEbile: something else you should avoid "
<< "while driving" << endl;
return 0;
}