Commit ae760637 authored by Martin, Daniel (UMSL-Student)'s avatar Martin, Daniel (UMSL-Student)
Browse files

Update hw1.cpp

parent 4ce3e9c6
......@@ -10,13 +10,14 @@
#include<iostream>
using namespace std;
const float GUT_FEELING = 20;
const int GUT_FEELING = 20;
const int AVG_SUGAR_CONSUMED = 2;
float num_people;
float avg_weight;
float lunch_money;
float lbs_sugar;
int num_duff_sodas;
float division;
bool include_SELM = false;
int main()
......@@ -36,7 +37,8 @@ int main()
lunch_money *= include_SELM;
//Formula for lbs of sugar to keep gamblers going
//lbs sugar = #people * (avgWeight * (avgSugarConsumption/gut feeling)+SELM)
lbs_sugar = num_people * (avg_weight * (AVG_SUGAR_CONSUMED/GUT_FEELING)+lunch_money);
divison = static_cast<float>(AVG_SUGAR_CONSUMED)/GUT_FEELING;
lbs_sugar = num_people * (avg_weight * (division)+lunch_money);
//Calculate duff soda equivalent (3 lbs sugar / duff soda"
num_duff_sodas = 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