//Charlotte Davies-Kiernan CS1A Chapter 3 P.144 #7
//
/*****************************************************************************
*
* Compute Amount of Calories
* ___________________________________________________________________________
* This program will calculate the amount of calories the user ate by asking
* the amount of cookies they ate and with knowing the amount of calories
* per cookie
*
* The formulas that will be used:
* cookies per serving = total cookies / servings
* calories per cookie = total cookies / servings
* calories eaten = cookies eaten * calories per cookie
* __________________________________________________________________________
* INPUT
* cookiesEaten // Amount of cookies eaten by user
* totalCookies // Amount of cookies in the package
* servings // Amount of servings in the package
* caloriesPerServing // Amount of calories per serving
* caloriesPerCookie // Amount of calories per cookie
* cookiesPerServing // Amount of cookies in a serving
*
* OUTPUT
* caloriesEaten //Total amount of calories eaten based on user's input
****************************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
int caloriesEaten; //OUTPUT - total amount of calories eaten
int caloriesPerCookie; //INPUT - amount of calories per cookie
int caloriesPerServing; //INPUT - amount of calories per serving
int cookiesEaten; //INPUT - amount of cookies user has eaten
int cookiesPerServing; //INPUT - amount of cookies in a serving
int servings; //INPUT - amount of servings in the package
int totalCookies; //INPUT - amount of cookies in the package
//
// User input
cin >> cookiesEaten;
//
//Variables
totalCookies = 40;
servings = 10;
caloriesPerServing = 300;
//
//Calculate Calories
cookiesPerServing = totalCookies / servings;
caloriesPerCookie = caloriesPerServing / cookiesPerServing;
caloriesEaten = cookiesEaten * caloriesPerCookie;
//
//Display to User
cout << "You consumed " << caloriesEaten << " calories.";
return 0;
}