Commit 2065465b authored by dlmfxq's avatar dlmfxq
Browse files

updated equations and removed variables.

parent d2a13e80
No preview for this file type
......@@ -17,8 +17,7 @@ float avg_weight;
float lunch_money;
float lbs_sugar;
int num_duff_sodas;
float division;
bool include_SELM = false;
int main()
{
......@@ -32,14 +31,11 @@ int main()
cout << "\tLunch money index(SELM):";
cin >> lunch_money;
cout <<"Calculating..." << endl;
//Only include SELM if #people > 5
include_SELM = num_people > 5;
lunch_money *= include_SELM;
//Formula for lbs of sugar to keep gamblers going
//lbs sugar = #people * (avgWeight * (avgSugarConsumption/gut feeling)+SELM)
//Only include SELM if >5 people
lbs_sugar = num_people * (avg_weight * (static_cast<float>(AVG_SUGAR_CONSUMED)
/GUT_FEELING)+(lunch_money*(num_people>5));
/GUT_FEELING)+(lunch_money*(num_people>5)));
//Calculate duff soda equivalent (3 lbs sugar / duff soda"
num_duff_sodas = static_cast<int>(lbs_sugar) / 3;
//Print results
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment