pacmanofftop1857 pacmanofftop1857
  • 25-11-2020
  • Computers and Technology
contestada

write a C++ program that ask the user for the number of cookies eaten and display the calorie consumption

Respuesta :

migueljnm940 migueljnm940
  • 26-11-2020

Answer:

#include <iostream>

using namespace std;

int main()

{

   int cookies;

   cin >> cookies;

   cout << "The calorie consumption is: " << cookies * 142 << endl;

   return 0;

}

Explanation:

First line: include basic library of C++(input and output).

using namespace std;

Says to compiler we are using std.

int main() Main function

int cookies, cookies variable, of int type

cin >> cookies

get the number of the cookies from user

cout Print the text and calories(one cookie have 142 calories)

Have a nice day ;)

Answer Link

Otras preguntas

What is the prevailing westerlies
Your spouse is a teacher at the local elementary school. Which retirement plan would she most likely have? Roth IRA Traditional IRA 401(k) 403(b)
Jeremy bought 3,000 milliliters of orange juice. How many liters of orange juice did he buy?
what is the best estimate for the sum of 3/8 and 1/12
Men often seek therapy more than women. Please select the best answer from the choices provided a. True b. False
why was martin luther not punished for being 'a heretic'
Some athletes now wear special shoes with spikes to get a better grip. What does this indicate?
____________ should cover every part of the worksite.
Rafael took 4 pumpkin pies to a family gathering. If he divides each pie into six equal size slices, how many slices can he serve?
Not characteristic of or related to English Romanticism is _____.