1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
S_A_V [24]
3 years ago
14

For this lab you will do 2 things:

Computers and Technology
1 answer:
zepelin [54]3 years ago
4 0

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.

You might be interested in
How many days has trump been a president
Free_Kalibri [48]
Hey there
_______________
The correct answer is
1 year, 64 days, 13 hours, 11 minutes and 44 seconds

__________
Hope this helps you
8 0
3 years ago
Read 2 more answers
Write 10 steps to make your presentation more effective
Over [174]
For me the some steps I use not 10 steps sorry are I always go through the slide and think what I am talking about. You have to understand what you are talking about and be clear and persuasive. Never look at the presentation. Memorize key phrases and keep your eyes at your audience. make each of your slides colorful so viewers will look at your actually slide.
4 0
4 years ago
Data is removed at the back of the queue.a) trueb) false
alexdok [17]

Answer:

true

Explanation:

4 0
3 years ago
Complete the statement below with the correct term.
nikitadnepr [17]

Answer:

DOMAIN

Explanation:

A utility that provides names to each computer on a network is called a DOMAIN naming service.

4 0
3 years ago
Identify an internal user who uses product lifecycle management (plm) software and its data.
Andrej [43]

<u> Quality assurance manager</u> is an internal user who uses product lifecycle management (plm) software and its data.

<h3>What is quality assurance manager?</h3>

The quality assurance manager is accountable for delivering optimum quality of a company's benefits or goods. In addition to maintaining constant quality, they help to ensure keeping with laws, regulations, and environmental standards, recommending improvements where required.

<h3>What is the qualification of a Quality Assurance Manager?</h3>

Quality Assurance Manager Requirements:

Bachelor's degree or associate's with knowledge in the field. Technical proficiency must be able to use computers and generate reports. Capacity to analyze data and create and review processes. Excellent communication skills.

To learn more about quality assurance manager, refer

brainly.com/question/15855298

#SPJ4

Complete question is,

a. Packaging supplier

b. Contract manufacturer

c. Manufacturer's design partner

d. Quality assurance manager

3 0
2 years ago
Other questions:
  • What is something you can do to stay connected to the relationships in your life while we spend this time at home?
    13·1 answer
  • A network of Bennetton retail sales agents select the Bennetton designs that they feel will appeal to Bennetton retail customers
    10·2 answers
  • Write a recursive method named binarySearch that accepts a sorted array of integers and an integer target value and uses a recur
    6·1 answer
  • Which software is used to play, create, and modify audio and video files?
    13·2 answers
  • Productivity can best be described as:
    5·2 answers
  • Taking an online class doesn't require any special skills.
    13·2 answers
  • Please Help Me!!!!!!!!!!!!!
    5·1 answer
  • What is the advantages and disadvantages of hardware devices and software devices ?
    9·1 answer
  • How would I collect a number from the user to use for the radius of a circle?
    13·1 answer
  • Explain why the receptionist responded as indicated in the following scenario.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!