hw6.cpp
/*Programmer: Dr. Bushra Anjum and Kenneth Fletcher
Date: 3-7-2015
File: hw6.cpp Class: cs1570
Purpose: This file contains the main function for the program
that calculates the wavelength of light to set the dial on the
Crime-o-Light 400 to.
Concepts: Switch-Case, Nested Loops, If-Else, Functions, Function Overloading
*/
#include "functions.h"
int main()
{
//Variables
int input=0;
float wavelength=0;
//The BIG while that ensures that the program continues until the
//user choses to exit/quit
while(input!=5)
{
presentMenuOptions();
cin>>input;
//Switch statement dealing with first four cases
switch(input)
{
case 1:
wavelength=getWavelength(getHairIndex());
cout<<"The wavelength of light emission is: "<<static_cast<int>(wavelength)<<" nm"<<endl;
break;
case 2:
wavelength=getWavelength(getInteger(2,7), getHairIndex());
cout<<"The wavelength of light emission is: "<<static_cast<int>(wavelength)<<" nm"<<endl;
break;
case 3:
wavelength=getWavelength(getInteger(1),getBoolean("Is the soup homemade?"));
cout<<"The wavelength of light emission is: "<<static_cast<int>(wavelength)<<" nm"<<endl;
break;
case 4:
wavelength=getWavelength(getInteger(0,6),getAlienHeight());
cout<<"The wavelength of light emission is: "<<static_cast<int>(wavelength)<<" nm"<<endl;
break;
}
wavelength=0;
}
//Goodbye message
goodbye();
return 0;
}