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]
3 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]3 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
Which job role requires you to set up an internet system access
user100 [1]

indeed I think it is correct

4 0
4 years ago
Why would it be beneficial to preview a page before printing?
enyata [817]
To make sure it looks how you want it to look, or to make sure all the info is correct and we're it should be.
4 0
3 years ago
!!General Chromebook Software Question!!
castortr0y [4]

Answer:

Explanation:

Google???

7 0
3 years ago
Read 2 more answers
One of the main reasons for copyright law is to encourage creators to share their work for the benefit of the general public. Pl
irina [24]

Answer:

ewatuqhfuyerhjf

Explanation:

true

8 0
3 years ago
What is design reference threat
timofeeve [1]
It’s a threat ‘make it spicey’ so with design
3 0
3 years ago
Other questions:
  • Because so many newspapers now have online versions of their publications, many observers feel that "circulation" is an insuffic
    11·1 answer
  • Write a program (C++) that reads a number between 1,000 and999,999 from the user where the user enters a comma in the input.Then
    13·1 answer
  • The following SQL statement contains which type of subquery? SELECT title FROM books WHERE EXISTS (SELECT isbn FROM orderitems W
    14·1 answer
  • Keith is researching a controversial topic and wants to use a website he found as an information source. Which of the following
    11·2 answers
  • What best describes a firewall
    11·1 answer
  • 4) Which is a more efficient way to determine the optimal number of multiplications in a matrix-chain multiplication problem: en
    15·1 answer
  • Subjective Questions
    11·1 answer
  • I really need this answer please
    5·1 answer
  • Is Microsoft team voice lagging for people who use it I want to know I only want to know if you use it ok not if you don’t.
    6·1 answer
  • Select the word or phrase from the drop-down menu to complete each sentence. File names consist of a ______ and a file extension
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!