// Programmer: Clayton Price 9/11/17
// File: hw2.cpp
// Purpose: this file contains the main function for the program that inputs
// user input to determine lens thickness.
#include <iostream>
using namespace std;
int main()
{
/* ------------------- DECLARATIONS ---------------- */
const int REFRACT_INDEX = 2;
const float NICKS_MIN_INCOME_CORRECTION_FACTOR = 4.2;
int left_acuity; //user's left eye acuity
int right_acuity; //likewise right eye
string name;
int soc_sec; //user's last four digits of soc sec
int ins_adjustment; //tens digit of soc sec
int lens_thickness;
bool has_ins = false; //indicates user has ins or not
/* ------------------ GREETING & INPUT ----------- */
cout<<"\n\n\n\tWELCOME TO LENS-O-MATIC"<<endl<<endl;
cout<<"Please enter your first name: ";
cin>>name;
cout<<"Ok, "<<name<<" now enter the following info: "<<endl;
cout<<"\tleft eye acuity: ";
cin>>left_acuity;
cout<<"\tright eye acuity: ";
cin>>right_acuity;
cout<<"\tlast four of ss: ";
cin>>soc_sec;
cout<<"\tdo you have insurance(1 - yes 0 - no): ";
cin>>has_ins;
/* ----------------- COMPUTATION --------------------- */
ins_adjustment = (soc_sec % 100) % 10;
lens_thickness = static_cast<int>((3 + static_cast<float>(left_acuity)/
(right_acuity + REFRACT_INDEX)) *
NICKS_MIN_INCOME_CORRECTION_FACTOR +
has_ins * ins_adjustment);
/* ----------------- OUTPUT OF INFO ----------------- */
cout<<"\n\nExcellent...the thickness of your lens'ss's should be: "<<endl
<<endl<<"\t\t"<<lens_thickness<<" cm"<<endl<<endl;
cout<<"Bye for now .......... exiting"<<endl<<endl;
return 0;
}