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
zlopas [31]
2 years ago
6

Silas develops this algorithm to compute the calories burned for an activity for a given number of minutes and body weight: If t

he activity is running, compute caloriesPerMin by dividing weight by 10.5 If the activity is walking, compute caloriesPerMin by dividing weight by 15.5 Compute numCalories by multiplying caloriesPerMin by numMinutes He implements the algorithm in an app, and users soon ask for the ability to compute the total calories for multiple sessions of walking or running. What structure must be added to the original algorithm so that it can compute the total across multiple sessions
Computers and Technology
1 answer:
NNADVOKAT [17]2 years ago
7 0

Answer:

Explanation:

This change can be accomplished in one of two ways. The first being creating a global variable that adds to it and saves the total calories burned at the end of every session. This global variable can then be called at any time to show the total number of calories burned in all previous sessions combined. The other option would be to create a list of Session objects. Each object would hold all the information regarding each session including calories burned. Then create a function that loops through this list, adding the total calories burned in each session and outputting the total.

You might be interested in
Write a program that repeatedly shows the user a menu to select the shape form three main shapes or to print the shapes created
fomenos

Answer:

Explanation:

The following code is written in Python. It creates a program that keeps printing out a menu allowing the user to create shapes. These shapes are saved in an array called shapes. Once the user decides to exit, it prints all of the shapes in the array along with their total area. The output can be seen in the attached picture below. Due to technical difficulties, I have added the code as a txt file below.

3 0
2 years ago
Load the we8there data set from the textir package. List the first 5 restaurants’ ratings from we8thereRatings. Based on we8ther
Readme [11.4K]

Answer:

> we8thereRatings[1:5,]

  Food Service Value Atmosphere Overall

1     5       5     5          5       5

2     5       5     5          5       5

5     5       5     4          4       5

11    5       5     5          5       5

12    5       5     5          4       5

3 0
3 years ago
Write a function sample_median(n,P) that generates n random values using distribution P and returns the median of the collected
TiliK225 [7]

Answer:

import numpy as np

def sample_median(n, P):  

   return np.median( np.random.choice ( np.arange (1, len(P) + 1 ), n, p = P ) )

print(sample_median(10,[0.1 0.2 0.1 0.3 0.1 0.2]))

print(sample_median(10,[0.1 0.2 0.1 0.3 0.1 0.2]))

print(sample_median(5, [0.3,0.7])

print(sample_median(5, [0.3,0.7])

Explanation:

  • Bring in the numpy library to use the median function provided by the numpy library.
  • Define the sample_median function that takes in 2 parameters and returns the median with the help of built-in random, choice and arrange functions.
  • Call the sample_median function by providing some values to test and then display the results.    

Output:

4.5

4.0

2.0

1.0

7 0
2 years ago
A _______________ hypervisor improves the performance of virtualization by removing the underlying operating system.
elena-14-01-66 [18.8K]
Type 1 hypervisor. also referred to as a
Bare-metal hypervisor
6 0
3 years ago
What type of thinking work does the computer need to do to solve the problem?
poizon [28]

Answer:

<h3>Computational Thinking is the thought processes involved in formulating a problem and expressing its solution in a way that a computer—human or machine—can effectively carry out.</h3>

Pa brainliest po

3 0
2 years ago
Other questions:
  • Which of the following groups would an animal with an exoskeleton, segmented body, and jointed appendages belong to???
    14·2 answers
  • Why is the answer A?
    6·1 answer
  • The identification of critical information is a key part of the OPSEC process because: a) It is required by the JTF commander to
    13·1 answer
  • Whats the best c++ compiler
    9·1 answer
  • Information from the system that is used to make modifications in the input, processing actions, or outputs is referred to as: G
    9·2 answers
  • Imagine that the following two lines of code are placed inside a
    11·1 answer
  • If the list above is named list1 and is implemented as a list, whatstatement would you use to find the number ofelements?list1.s
    9·1 answer
  • What is known as networking in the IT field?
    8·1 answer
  • Compress<br> 00eb:0000:0000:0000:d8c1:0946:0272:879<br> IPV6 Address
    9·1 answer
  • I need help on this, need answer asap.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!