// Programmer: Donald Duck, Esq. date: 2/1/21
// File: hw1.cpp
// Purpose: this file contains the main function for the program to calculate sugar volume for Bart's gambling house.
#include <iostream>
using namespace std;
int main()
{
/* ------------------------------ DECLARATIONS ---------------------------- */
const int AVE_SUGAR_CONSUMPTION = 2; //in pounds per week
const int BARTS_FEELINGS = 20; //some ridiculous constant we thought up
const int POPULATION_THRESHOLD = 5; //num gamblers to kick in lunch money component
const int SODA_SUGAR_CONTENT = 3; //num lbs of sugar in a Duff soda
float num_gamblers;
float ave_gambler_wt;
float lunch_money_index;
bool lunch_money_decider = false;
float lb_sugar;
int num_sodas;
/* ----------------------------- Greeting and inputs -------------------- */
cout<<endl<<endl<<endl<<" Sugar-mania Calculator "<<endl<<endl;
cout<<"Please enter the following:"<<endl<<endl;
cout<<" How many gamblers: ";
cin>>num_gamblers;
cout<<" What is their average wt: ";
cin>>ave_gambler_wt; //in pounds
cout<<" Springfield Money Index: ";
cin>>lunch_money_index;
/* -------------------------------- COMPUTATIONS and OUTPUTS ------------ */
lunch_money_decider = ( num_gamblers > POPULATION_THRESHOLD);
lb_sugar = num_gamblers * (ave_gambler_wt * (static_cast<float>(AVE_SUGAR_COMSUMPTION) / BARTS_FEELINGS)
+ lunch_money_decider * lunch_money_index);
num_sodas = static_cast<int>(lb_sugar) / SODA_SUGAR_CONTENT;
cout<<"For your program, you need:"<<endl
<<" pounds of sugar: "<<lb_sugar<<" lbs"<<endl
<<" "equivalent to: "<<num_sodas<<" sodas"<<endl<<endl;
cout<<".......Exiting.....Have a good day...surviving on your sugar rush!!!"<<endl;
return 0;
}
return 0;
}