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
Sati [7]
4 years ago
13

A programmer wants to write a procedure that calculates the net elevation - total number of feet a traveler goes up and down. Fo

r example, looking at the first 3 segments of travel, the net elevation is 7 feet (up 3, up 1, down 3). Write procedure (in either JavaScript or pseudocode) called processPath(data) that: Accepts a list of elevation data as a parameter For every value in the list Compute the absolute difference between that value and the value next to it on the path Add the difference to a running total Return the total elevation traveled
Computers and Technology
1 answer:
ch4aika [34]4 years ago
3 0

Answer:

Pseudocode

////////////////////////////////////////////////////////////////////////////////////////////////////////////

Integer netElevation(list of elements of type elevation - type and number)

<em>function open</em>

   Define running total = 0

   for each element from list

   <em>loop open</em>

       elevation type = element[i].type

      if (elevation type == Up)

           running total = running total + element[i].number

       else

           running total = running total - element[i].number

   <em>loop close</em>

   return running total

<em>function close</em>

You might be interested in
There is a population of owls in a forest. In one year there are 20 new owls born and 10 owls die. In this same year, 5 owls ent
Simora [160]

Answer:

The owls population increased by 13 in one year

Explanation:

The given data on the owl population are as follows;

The number of new owls born = 20 (positive increase in population)

The number of owls that die = 10 (negative decrease in population)

The number of owls that enter the forest = 5 (positive increase in population)

The number of owls that left the forest = 2 (negative decrease in population)

Let 'w' represent the number of new owls born, let 'x' represent the number of  owls that die, let 'y' represent the number of owls that enter the forest and let 'z' represent the number of owls that left the forest, we get;

The change in population, ΔP = w - x + y - z

By plugging in the values, we get;

ΔP = 20 - 10 + 5 - 2 = 13

The change in the population of owls in one year is an increase in 13 owls.

4 0
3 years ago
Which shortcut key combination will move the cursor to the beginning of the line?
Lina20 [59]

Answer:

Home Key

Explanation:

To move the cursor to the beginning of line:

Press `HOME` button on keyboard

5 0
3 years ago
Choose the option that best matches the description given. The older term, social service, referred to advancing human welfare.
egoroff_w [7]

Answer:

Social Assistance

Explanation:

Provision and disbursement of intervention in other to palliate the suffering and want of an individual, group or community can be described as rendering social assistance. Assistance which also means helping people fulfill their needs could be offered by the government, non-governmental organizations or individuals personnels. Rendering social assistance could be in the form of cash or gift offerings, provision of food for the hungry, shelter for the homeless, medical interventions for the sick and catering for other touch points of the needy.

4 0
3 years ago
PLEASE HELP ME
alexira [117]

Answer:

it won't be able to run

Explanation:

because computer runs on physical memory

5 0
2 years ago
An attacker has hidden an NFC reader behind an NFC-based kiosk in an airport. The attacker uses the device to capture NFC data i
tatiyna

Answer:

Nfc relay attack

Explanation:

The NFC relay attack occurs when data is extracted by an attacker who puts himself in the middle of two parties having a communication with each other. As the message gets to a party, the attacker gets it and modifies it to their taste then passes it on.

This attacker in this question is extracting data by establishing communication between end user devices and reader in the kiosk

5 0
3 years ago
Other questions:
  • What are the role, responsibilities, and required background of the production designer of a film?
    6·1 answer
  • Cloud computing is the fastest growing form of computing. <br> a. True <br> b. False
    9·1 answer
  • A __________ network is good for connecting computers over boundaries.
    6·2 answers
  • A merge is _____.
    5·2 answers
  • Which of the following is a step in paraphrasing?
    14·2 answers
  • Assume that two parallel arrays have been declared and initialized: healthOption an array of type char that contains letter code
    13·1 answer
  • Which of the following is a strategy used to enhance communication in a presentation?
    14·1 answer
  • What is the traditional computer architecture long-supported by windows?
    6·1 answer
  • Assignment 2 edhesive
    8·2 answers
  • Match the data-management concepts to their meanings.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!