A bag of cookies contains 40 cookies. The calorie information printed on the bag claims that...

80.3K

Verified Solution

Question

Programming

A bag of cookies contains 40 cookies. The calorie informationprinted on the bag claims that there are 8 servings in each bag andthat a single serving equals 300 calories. Design and write a C++program that prompts your user for the number of cookies that he orshe ate and then displays the calories they consumed.

Use variables to represent the given information, such as thenumber of cookies in each bag and the number of calories in eachserving. Compose statements using the given variables to calculatethe number of calories in each cookie. Use the number of cookiesand the number of calories per cookie to determine how manycalories were consumed. The use of magic is not permitted incomputer programming. You, as the programmer must compose stepsthat store given information in variables and then use thesevariables to determine values such as the number of calories ineach cookie.

CODE IN C++

Answer & Explanation Solved by verified expert
3.7 Ratings (676 Votes)
AnswerYour code is    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students