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]
3 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]3 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
What directs the read/write arm of the hard drive to where data exists and accesses it upon the user's request?
Nastasia [14]

Answer:

NTFS (New Technology File System) or FAT(File Allocation Table) are used to direct read/write arm of hard drive to where data exists and access it upon user's request

Explanation:

Both NTFS and FAT are used but NTFS is fast and optimal and superseed the FAT and supported by windows NT 3.1 and later versions.  

7 0
2 years ago
________ are devices in a computer that are in either the on or off state
Vanyuwa [196]
The appropriate response is Electrical Switches. These are electromechanical gadgets that are utilized as a part of electrical circuits to control, recognize when frameworks are outside their working reaches, flag controllers of the whereabouts of machine individuals and work pieces, give a way to manual control of machine and process capacities, control lighting, et cetera.
6 0
3 years ago
What is an active cooling solution for a PC?
mina [271]
Reduce the speed of the CPU
6 0
3 years ago
Read 2 more answers
How many rows appear in a truth table for the compound proposition: \[(p \leftrightarrow q) \oplus (\neg p \leftrightarrow \neg
AURORKA [14]
Let me re-write the proposition:

p↔q⊕(¬p↔¬r)∧¬q.

Generally, the number of rows in a truth table depends on the number of Variables. Here we have 3 Variables: p,q and r. Each of them can have either the value of 1 or 0, which gives us 2*2*2 possibilities, or 2³, that is 8 possibilities and 8 rows:

p=0, q=0, r=0
p=0, q=0, r=1
p=0, q=1, r=0
p=0, q=1, r=1
p=1, q=0, r=0
p=1, q=0, r=1
p=1, q=1, r=0
p=1, q=1, r=1







4 0
2 years ago
In a ____ environment, you can change directories using the cd command. For example, to change to a directory named MyClasses, y
GrogVix [38]
DOS, is your answer
7 0
2 years ago
Other questions:
  • Adam would like to reduce the size of an image that he inserted into a document. He selects the image and chooses the Crop optio
    11·2 answers
  • Given the following function definition, what modifications need to be made to the search function so that it finds all occurren
    7·1 answer
  • Someone asks you for help with a computer that hangs at odd times. You turn it on and work for about 15 minutes, and then the co
    7·1 answer
  • You can't get close enough to the facility interior to launch an evil twin attack against its wireless clients; in fact, you hav
    11·1 answer
  • The famous study entitled ""Protection Analysis: Final Report"" focused on a project undertaken by ARPA to understand and detect
    14·1 answer
  • What concept or principle requires layered, complementary controls sufficient to detect and deter infiltration and exploitation
    6·1 answer
  • Double bar graphs compare multiple what
    11·1 answer
  • Why might reading a product review be a good idea before purchasing a product?
    5·2 answers
  • Por que se dice que la tecnología ha tenido muchos aportes positivos para la sociedad pero también nos ha hecho dependientes de
    9·1 answer
  • The project objective is the detailed description of the characteristics of the project. True or False?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!