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
Naddika [18.5K]
3 years ago
14

Can you explain what the pseudo-code below is trying to do? array[N] # array of N integers, indexed 0 to N-1; #assume it's popul

ated with (1,4,2,-2,-9,10,2,12,2,-4,-4,-4,-4,2,6,7] peak = array[0] index = 0 output = [] # array of tuples For x in 1..N-1 if (array[x]*array[x-1) > 0) if peak < 0 and array[x] < peak peak = array[x] index = x if peak >= 0 and array[x] > peak peak = array[x] index = x else output.insert( (index, peak)) peak = array[x] index = x end if end for return output
Engineering
1 answer:
Zina [86]3 years ago
3 0

Answer:

what the pseudo-code is trying to do is to compute a range of display for integers from 0 to N-1.

Explanation:

The pseudo-code is trying to display integers from 0 to N-1.

By the line 1 we can see that ,peak=array[0]index=0 output. meaning when 0 is inputted into the array it should display 0 as the result.

and the result follows with the other array also.

The array[x] index is used for generalization of the integers.

if (array[x]*array[x-1) > 0) if peak < 0 and array[x] < peak peak = array[x] index = x if peak >= 0 and array[x] > peak peak = array[x] index = x.

the bold line above simply means the value will be computed once this requirement has been met else the output will display insert( (index, peak)) peak = array[x] index = x end if end for return output

once the value has not been reinserted the program ends.

Pseudo-code is simply an artificial language that  programmers usually use in developing algorithms.

Pseudo-code is a  detailed algorithmic design tool. Pseudocode is straightforward.  with all of its  statements showing "dependency" are to be indented. These may include while, do, for, if, switch.

You might be interested in
scrapers are used to haul dirt from a borrow pit to the cap of a landfill. the estimated cycle time for the scrapers is 9.5 minu
ladessa [460]
Answer is: 12.8 because when you multiply it by the 2nd power of 8 then the scraper equals to be 12.8 in height and that’s how much each scraper requires to operate :)
7 0
3 years ago
write a paragraph on how iron and copper(separately) is manufactured, what it consists of and processes that it went through to
trasher [3.6K]

Answer:

Iron is manufactured in a blast furnace. First, iron ore is mixed with coke and heated to form an iron-rich clinker called 'sinter'. Sintering is an important part of the overall process as it reduces waste and provides an efficient raw material for iron making. Coke is produced from carefully selected grades of coal.

Copper is typically extracted from oxide and sulfide ores that contain between 0.5 and 2.0% copper. ... Regardless of the ore type, mined copper ore must first be concentrated to remove gangue or unwanted materials embedded in the ore. The first step in this process is crushing and powdering ore in a ball or rod mill.

5 0
3 years ago
2.11 Consider a 400 mm × 400 mm window in an aircraft. For a temperature difference of 90°C from the inner to the outer surface
alexandr402 [8]

Answer:

The heat loss rate through one of the windows made of polycarbonate is 252W. If the window is made of aerogel, the heat loss rate is 16.8W. If the window is made of soda-lime glass, the heat loss rate is 1190.4W.

The cost associated with the heat loss through the windows for an 8-hour flight is:

For aerogel windows: $17.472 (most efficient)

For polycarbonate windows: $262.08

For soda-lime glass windows: $1,238.016 (least efficient)

Explanation:

To calculate the heat loss rate through the window, we can use a model of heat transmission by conduction throw flat wall. Using unidimensional Fourier law:

\frac{dQ}{dt}=\dot Q =-kS\nabla \vec{T}

In this case:

\dot Q =k\frac{S}{L} \Delta T

If we replace the data provided by the problem we get the heat loss rate through one of the windows of each material (we only have to change the thermal conductivities).

To obtain the thermal conductivity of the soda-lime glass we use the graphic attached to this answer (In this case for soda-lime glass k₃₀₀=0.992w/m·K).

To calculate the cost associated with the heat loss through the windows for an 8-hour flight we use this formula (using the heat loss rate calculated in each case):

Cost=C_{hc}\cdot \dot Q \cdot t \cdot n=1\frac{\$}{Kwh} \cdot \dot Q \cdot 8h \cdot 130

6 0
3 years ago
Can the United States defeat Iranian forces
Lostsunrise [7]

Answer:

yes for sure

Explanation:

iran oy has 3000 ballistic missiles but america has thousands of nukes. we can easily outnumber their forces as well. this will be a easy victory for us but will result in massive casualties on both sides

5 0
3 years ago
Read 2 more answers
What type of engineer would be most likely to develop a design for cars? chemical civil materials mechanical
Andreyy89
I don’t know but good luck
4 0
3 years ago
Other questions:
  • Which BEST identifies a contrast in these two passages? A) The actions taken by the bird in the poem cause injuries, but the act
    5·1 answer
  • 10 kg/s Propane at 10 bar and 20 C is directed to an adiabatic rigid mixer and is mixed with 20 kg/s Propane at 10 bar and 40 C.
    11·1 answer
  • A eutectic alloy is which of the following (two correct answers): (a) the composition in an alloy system at which the two elemen
    7·1 answer
  • A tensile test uses a test specimen that has a gage length of 50 mm and an area = 206 mm2. During the test, the specimen yields
    13·1 answer
  • Where do the names of counterweight items originally come from
    7·2 answers
  • Which of the following identifies one factor that causes conventional tillage to actually be good for the environment?
    7·1 answer
  • How do you take a picture
    14·2 answers
  • Calculate the magnitude of the velocity and the θ angular direction of the block and the bullet together when the 50 g bullet mo
    10·1 answer
  • On some engines after torquing cylinder head fasteners you must
    12·1 answer
  • Which of the following is a correct version of a user story?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!