// Nicolas Ruano CS1A Chapter 3 Pp. 144 # 7
/******************************************************************************
* SOLVING AVERAGE CALORIES
* ____________________________________________________________________________
* INPUT
* Cookies per bag = 40
* Servings per bag = 10
* Calories per serving = 300
* ____________________________________________________________________________
* PROCESSING
* caloriesPerCookie = (CALORIES_PER_SERVING * SERVINGS_PER_BAG) / COOKIES_PER_BAG
* results for cookies eaten: 5
* ____________________________________________________________________________
* OUTPUT
* totalCalories = cookiesEaten * caloriesPerCookie
*
* Results = 375 calories
*****************************************************************************/
#include <iostream>
using namespace std;
int main() {
const int COOKIES_PER_BAG = 40;
const int SERVINGS_PER_BAG = 10;
const int CALORIES_PER_SERVING = 300;
// Calculate calories per cookie
int caloriesPerCookie = (CALORIES_PER_SERVING * SERVINGS_PER_BAG) / COOKIES_PER_BAG;
int cookiesEaten;
cout << "How many cookies did you eat? R:/ 5 cookies\n";
cin >> cookiesEaten;
int totalCalories = cookiesEaten * caloriesPerCookie;
cout << "You consumed approximately 375" << totalCalories << " calories." << endl;
return 0;
}