Answer:
Here is the Python program:
COOKIES_PER_BAG = 40 #sets constant value for bag of cookies
SERVINGS_PER_BAG = 10 #sets constant value for serving in bag
CALORIES_PER_SERVING = 300 #sets constant value servings per bag
cookies = int(input("How many cookies did you eat? ")) #prompts user to input how many cookies he or she ate
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG)); #computes total calories consumed by user
print("Total calories consumed:",totalCalories) #displays the computed value of totalCalories consumed
Explanation:
The algorithm is:
- Start
- Declare constants COOKIES_PER_BAG, SERVINGS_PER_BAG and CALORIES_PER_SERVING
- Set COOKIES_PER_BAG to 40
- Set SERVINGS_PER_BAG to 10
- Set CALORIES_PER_SERVING to 300
- Input cookies
- Calculate totalCalories: totalCalories ← cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG))
- Display totalCalories
I will explain the program with an example:
Lets say user enters 5 as cookies he or she ate so
cookies = 5
Now total calories are computed as:
totalCalories = cookies * (CALORIES_PER_SERVING / (COOKIES_PER_BAG / SERVINGS_PER_BAG));
This becomes:
totalCalories = 5 * (300/40/10)
totalCalories = 5 * (300/4)
totalCalories = 5 * 75
totalCalories = 375
The screenshot of program along with its output is attached.
Answer:
Computer engineering is a career that works on the development and research of new technology-related things.
Explanation:
Answer:
loop or a repeating block. I think it’s this because I like robotics and I have to know a lot of different kinds of blocks.
Explanation:
This is why.
The way in which Alexander can best improve his study area is that: D. he can put his computer on a desk and sit in a comfortable chair.
<h3>What is a laptop?</h3>
A laptop can be defined as a small, portable type of computer that is designed and developed by embedding both a mousepad and keyboard on it.
Also, it is usually light enough to be placed on an end user's lap while he or she is working.
In this scenario, the way in which Alexander can best improve his study area is that he can put his computer on a desk and sit in a comfortable chair.
Read more on a laptop here: brainly.com/question/26021194
#SPJ4
Stopping the car. Do not continue driving if your tire has failed or blown out. After you stop the car, call for roadside assistance. Remember, safety first when you're driving!