Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Hello. I need some assistance in solving this problem for my computer programming class. The program I use is Python 3.7, and I also want

Hello. I need some assistance in solving this problem for my computer programming class. The program I use is Python 3.7, and I also want a pseudocode for this program as well.

Thanks.

Problem: A bag of cookies holds 40 cookies. The calorie information on the bag claims that there are 10 servings in the bag and that a serving equals 300 calories. Write pseudocode to solve this problem and then write a Python program that asks the user to input how many cookies he or she ate and then reports how many total calories were consumed.

*You MUST USE constants to represent the number of cookies in the bag, number of servings, and number of calories per serving. Remember to put constants in all caps!

Make sure to declare and initialize all variables before using them! Then you can do the math using those constants to find the number of calories in each cookie.

Make this program your own by personalizing the introduction and output.

Sample Output:

WELCOME TO THE CALORIE COUNTER!!

Please enter the number of cookies consumed: 5

You consumed 375 calories.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions