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
Pro and Cons of Artificial Intelligence in Art <br><br> You must have 3 statements in each
Anni [7]

Answer:

The answer is below

Explanation:

Aritifiaicla intelligence in art is an artwork created by the application of artificial intelligence software.

Some of the pros of artificial intelligence in the art are:

1. It creates a new and improved interface, specifically in graphic design such as virtual reality and 3D printing

2. It creates and mixes the artistic ideas properly, such as mixing of different instruments in music to creates a new sound

3. It establishes graphical and visual display with no blemishes o,r error when applied accordingly, such as AUTOCAD

The cons of artificial intelligence in art are:

1. Artificial Intelligence lacks emotional sense. Hence it is challenging to display artistic elements that portray genuine emotions

2. It lacks creativity. Unlike humans, artificial intelligence is not as creative as humans when it comes to words or sentence constructions in an artistic sense.

3. It doesn't apply experience to its productions. Arts can be improved with more understanding of what is happening in the society or environment; artificial intelligence cannot translate its experience into arts formation.

6 0
3 years ago
Fill in this function that takes three parameters, two Strings and an int. 4- // Write some test function calls here! The String
zimovet [89]

Answer:

The function in Java is as follows:

public static void printMessage(String lineOne, String lineTwo, int lines){

       for(int i = 1;i<=lines;i++){

           if(i%2 == 1){

               System.out.println(lineOne);

           }

           else{

               System.out.println(lineTwo);

           }

       }

   }

Explanation:

This defines the function

public static void printMessage(String lineOne, String lineTwo, int lines){

This iterates through the number of lines

       for(int i = 1;i<=lines;i++){

String lineOne is printed on odd lines i.e. 1,3,5....

      if(i%2 == 1){

               System.out.println(lineOne);

           }

String lineTwo is printed on even lines i.e. 2,4,6....

           else{

               System.out.println(lineTwo);

           }

       }

   }

To call the function from main, use:

printMessage("Hi", "Karel", 5);

8 0
3 years ago
Who will help me with a test on Computer Science plz will help you level up and upvotes!!!!! plzzzzzzzzzzzzzzzzzzz
Diano4ka-milaya [45]
Sure, depends what you need help with!
5 0
2 years ago
Read 2 more answers
What are some preferences you can set in photoshop?
pishuonlain [190]

Answer: face brightness

Explanation:

hope this is the right answer :)

5 0
2 years ago
Identify why research and a clearly written problem statement are important. Select all that apply. They result in a clear and c
saveliy_v [14]

Answer:

They result in a clear and concise statement of the problem

They ensure that all stakeholder needs are considered.

They result in a document that is easy to understand

Explanation:

Problem statement are very vital in research they are key notes that tells what the research is all about and solution it will provide. They are key notes to understand a research and the knowledge gap the research is filling.

Problem statement is a guide through which solution are measured, it gives a clear direction of what the research is all about.

Problem statement are usually easy to understand, they are written in ways that everyone who picks the paper up can understand why the research was conducted.

All this are why a problem statement is important.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Peter has a website that promotes his local vacation rental site. He uses Google Ads to manage his advertising campaign. He’s cr
    13·1 answer
  • Your desktop, internet explorer, and the media player can be started from this area on most computers
    9·1 answer
  • Spoken word and written word are different because what
    9·1 answer
  • What is the correct process for selecting an entire row in a spreadsheet?
    8·2 answers
  • A type of Knowledge Management System is called
    5·1 answer
  • You have this code in your program.
    7·1 answer
  • Second Largest, Second Smallest Write a program second.cpp that takes in a sequence of integers, and prints the second largest n
    15·1 answer
  • Please could you help me
    6·2 answers
  • Whats 12/29 divided by 12/34
    7·2 answers
  • the human resources department requests a list that contains the number (i.e. count) of orders taken on each date, grouped by th
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!