//Cecilia Rangel CSC5 Chapter 3, P. 144, #7
//
/**************************************************************
*
* Computes calories eaten
* ____________________________________________________________
* This program calculates how many calories the user has eaten
* by how many cookies they ate.
*
* Calculation is based on this Formula:
* 1 serving= 300 calaries
*___________________________________________________________
* INPUT
* cookiesEaten : user input
* cookiesInBag : 40 cookies
* servingsInBag : 10 servings
* caloriesPerServing: 300 Calories
*
* OUTPUT
* caloriesConsumed : Amount of calories the user ate
*
**************************************************************/
#include <iostream>
using namespace std;
int main() {
float cookiesEaten;
float cookiesInBag;
float servingsInBag;
float caloriesPerServing;
float cookiesPerServing;
float caloriesPerCookie;
float caloriesConsumed;
cookiesInBag = 40;
servingsInBag = 10;
caloriesPerServing = 300;
cookiesPerServing = cookiesInBag / servingsInBag;
caloriesPerCookie = caloriesPerServing / cookiesPerServing;
cout << "How many cookies did you eat?" << endl;
cin >> cookiesEaten;
caloriesConsumed = cookiesEaten * caloriesPerCookie;
cout << "You ate " << caloriesConsumed << " calories.";
return 0;
}