// Programmer: Clayton Price date: 2/10/14
// File: iq_loss.cpp class: cs53
// Purpose: this file contains the main function for the program to compute
// iq loss when eating glue......for Ralph.
#include <iostream>
using namespace std;
int main()
{
/* ------------------------- DECLARATIONS -------------- */
const float GLUE_POTENCY = 20.0;
const float STUP_WIG_GENE_FACTOR = 1.6;
const int GLUE_SAFE_IQ = 150;
short iq;
short age;
short num_crayolas;
short iq_loss = 0;
float amnt_paste;
bool father_is_chief = false;
bool is_glue_intollerant = false; // used to multiply in a factor of 0 or
// 1 to reflect tollerance to glue based
// on GLUE_SAFE_IQ level.
/* ------------------------ GREETIN'S AND DOIN'S ----------- */
cout<<endl<<endl<<endl;
cout<<"\t\t******WELCOME RALPH TO THE IQ LOSS CALCULATOR *******"<<endl<<endl;
cout<<"Enter the following info: "<<endl
<<"\tYour IQ: ";
cin>>iq;
cout<<"\tYour age: ";
cin>>age;
cout<<"\tAmount of past you ate(oz): ";
cin>>amnt_paste;
cout<<"\tNumber of crayolas in your nose(don't sneeze!): ";
cin>>num_crayolas;
cout<<"Is your father the police chief?(yes -> 1 no -> 0) ";
cin>>father_is_chief;
cout<<endl<<endl;
/* -------------------- COMNPUTATIONS AND OUTPUT ------------ */
is_glue_intollerant = (iq < GLUE_SAFE_IQ);
iq_loss = static_cast<short>((static_cast<float>(age)/iq) *
(GLUE_POTENCY * amnt_paste) + (STUP_WIG_GENE_FACTOR * num_crayolas
* father_is_chief));
iq_loss *= is_glue_intollerant; // zeros out loss if smart guy
cout<<"\nYour IQ lost is "<<iq_loss<<endl<<endl;
cout<<"***** Goodbye Ralph, you glue-head ......... "<<endl;
return 0;
}