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]
4 years ago
14

For this lab you will do 2 things:

Computers and Technology
1 answer:
zepelin [54]4 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
Which type of multiple inheritance does Java support?
patriot [66]

Answer:4)Multiple inheritance of interfaces only

Explanation:Java has the property of not supporting the multiple inheritance feature. It cannot support the multiple inheritance with the help of classes directly but with the help of interfaces,it is possible. The multiple inheritance with the help of classes may lead to the problem of overriding of the classes being inherited.

Therefore,the correct option is option(4)

5 0
4 years ago
A(n) ____ web site structure connects web pages in a treelike structure.
galben [10]
Is it a multiple choice question?

6 0
3 years ago
A developer has made a change to an Automation Anywhere TaskBot using the Enterprise Client interface. When running the bot from
Furkat [3]

Answer:

Copy the Task Bot from the client device to the control room server.

Explanation:

First, we need to understand what we mean by Automation Anywhere: This is a web based controlled and  popular robotic process automation (RPA) vendors offering powerful & user-friendly RPA capabilities to automate any complex tasks. It is one of the "Revolutionary Technology" that changes the way the enterprise operates. This tool combines conventional RPA with intellectual elements like natural language understanding and reading any unstructured data.

Automation Anywhere allows organizations to automate the processes which are performed by the humans. It is a Web-Based Management System which uses a Control Room to run the Automated Tasks. Automation Anywhere tool can automate ends to end business operations for companies.

4 0
4 years ago
Which unit of the computer works as the input​
PolarNik [594]

Answer:

Center Processing Unit ....

4 0
3 years ago
____ programs are software programs that are distributed on the honor system.
Nostrana [21]
Shareware program and they are also used free of charge.**
3 0
4 years ago
Read 2 more answers
Other questions:
  • Where can you make changes to AutoCorrect?
    14·2 answers
  • In a certain computation, 90% of the work is vectorizable. Of the remaining 10%, half is parallelizable for an MIMD machine. Wha
    9·1 answer
  • Your boss wants you to set up an authentication scheme in which employees will use smart cards to log in to the company network.
    15·1 answer
  • Question 19 :Rachel, a database administrator, has created a database for her website. It contains pictures of vacations that pe
    13·1 answer
  • Create a program named Reverse3 whose Main() method declares three integers named firstInt, middleInt, and lastInt. Assign the f
    9·1 answer
  • When Gina was 10, she swam in the ocean for the first time. She remembers the feeling of kicking her feet, slicing her arms thro
    12·1 answer
  • Which of the following protocols help IP in multicast service?
    9·2 answers
  • You are dropping your friend back home after a night at the movies. From the car, she turns on the indoor lights in her home usi
    9·1 answer
  • Type of cable installed on a patch panel?
    15·1 answer
  • A Chain of dry-cleaning outlets wants to improve its operations by using data from devices at individual locations to make real-
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!