Write a method called dangerousDescent that determines whether there is a downhill section in the hiking trail with a gradient of more than -5%. The gradient is calculated by the rise in elevation over the run in distance. For example, the last kilometer section has a gradient of -1% because the rise in elevation is 40 - 50 = -10 meters. The distance covered in 1000 meters. -10 / 1000 = -1%.


Your method should return true if there exists a dangerous descent in the given array, false otherwise.

Answers

Answer 1

Answer: the explanation gives you the code used

Explanation:

There are several ways to go about this, here is just one way to carry out this computation.

#include <iostream>

using namespace std;

bool dangerousDescent(int* elevationArray , int sizeOfElevationArray)

{

  //we calculate gradient throughout elevationArray and if any one of them is more than -5%

  //then return true else return false

  //gradientOfSectionX = rise in elevation/Distance covered in merters

  //where rise in elevation is (elevationOfX - elevationOfX_previous)

  bool isDangerousDecent = false;

  float gradient = 0;

  int threshold = -5;

  float riseInElevation = 0;

  for (int i = 0; i < sizeOfElevationArray && isDangerousDecent == false; i++)

  {

      if (i > 0)

      {

          //check to avoid array out of bound error

          riseInElevation = (elevationArray[i] - elevationArray[i - 1]);

          gradient = riseInElevation / 1000; //1000 meters = 1km because every marker is at 1 kilometer distance

          gradient = gradient * 100; //percentage

          if (gradient > threshold)

          {

              isDangerousDecent = true;

              cout << "There is a gradient of " << gradient << "% on section " << elevationArray[i] << " of hiking trail " << endl;

          }

      }

      //first section not included because that was starting point with 0% elevatoin

     

  }

  return isDangerousDecent;

}

int main()

{

  int elevationArray[] = { 100,50,20,30,50,40 };

  int size = sizeof elevationArray / sizeof elevationArray[0];

  if (dangerousDescent(elevationArray, size) == true)

  {

      cout << "There is a dangerous decent of gradient more than -5% in hiking trail " << endl;

  }

  else

  {

      cout << "There is no dangerous decent of gradient more than -5% in hiking trail " << endl;

  }

  system("pause");

}


Related Questions

How can you access the Help and Support system?


Answers

Answer:

i dont know go to settings

Explanation:

Your profile into settings

What do newly PivotTables look like?

Answers

When creating a new PivotTable in Excel, you start with an empty grid and a 'Pivot Table Field List' panel to format the data. After selecting the data range and choosing a new worksheet, you customize the table using this panel, which could include calculating averages. You can also create PivotCharts for graphical data presentation.

When you create a new PivotTable, it typically starts as an empty grid in a new worksheet, with a panel on the right side called the Pivot Table Field List. This panel is where you format and arrange your data fields. The process of creating a PivotTable involves selecting all the data you wish to analyze, including data labels, and then choosing PivotTable from the Insert menu. After specifying a new worksheet, you can drag and drop fields to arrange your data and perform functions like calculating averages. The resulting table is a powerful tool that summarizes the data, allowing for advanced analysis such as comparing means or evaluating other statistics.

Using additional features such as PivotChart, you can also visually represent the summary data by selecting the PivotChart option from the Tools toolbar once your PivotTable has been constructed. The Excel interface may differ by version, but these general steps apply for creating a summarizing and powerful presentation of data. The final PivotTable presents a concise summary of the data arranged as per the user's specifications.

Answer: the answer is empty

Explanation:

Which event on Earth led to the invention of Newtri?

Answers

i think it’s A not sure

The invention of agriculture led to the invention of Neolithic by providing a larger and more dependable food supply and allowing humans to settle down in villages and cities. This shift in lifestyle resulted in continued population growth and brought about significant changes in human society. Correct option is D. People didn't appreciate real food and wanted something different.

The invention of agriculture around 10,000 years ago led to the invention of Neolithic because it provided a larger and more dependable food supply.

With agriculture, humans were able to settle down into villages and cities, and this shift in lifestyle allowed for continued slow population growth.

Agriculture also brought about changes in how humans understood land, organized socially, and acquired wealth, ultimately leading to the establishment of sophisticated Neolithic settlements.

Correct option is D. People didn't appreciate real food and wanted something different.

The probable question may be:

3. Which event on Earth led to the invention of Newtri?

A. People didn't have time to cook a full meal.

B. After the bees died, people started starving.

C. After the forest fires, nothing grew on the land.

D. People didn't appreciate real food and wanted something different.

Alia has always been described by her friends as
someone why continually tries to better herself
and always has a goal or project to work on. She
seeks ways to reduce stress, and she strives to
balance spending time alone and being with
others.
Which need is Alia focused on meeting?
DONE

Answers

the answer ia maybe the first one i think

Answer:

Self-Actualization

Explanation:

In what ways are outlook notes useful for personal or professional use?

Answers

Final answer:

Outlook notes are useful for making quick notes, organizing tasks, and can sync across devices, aiding in both personal and professional productivity. They can also assist in the drafting and refining of professional emails, reflecting well on the individual and organization.

Explanation:

Outlook notes are an essential tool for both personal and professional use. They serve a variety of purposes, such as enabling users to make quick and informal notes, jot down tasks, and even record audio. The advantages are manifold: these notes can be synced across devices for access anytime, anywhere—increasing efficiency and productivity in any work environment. In today's business context, effective verbal and written communication are crucial, and using tools like Outlook notes helps maintain organization and clarity.

When sending professional emails, it is important to use a professional language and maintain a formal tone, as emails often serve as a reflection of both the individual and the company they represent. Outlook notes can be used to draft and perfect such correspondence before sending. Moreover, by tagging and organizing emails and notes efficiently, professionals can enhance their email management practices to ensure timely and accurate information flow within and outside the organization. Using notes in conjunction with emails can help to plan projects, create reminders for follow-ups, and collate information received or to be sent, thereby streamlining workplace productivity.

When looking at the calendar, how does the default view arrange the time slots?
10-minute increments
15-minute increments
30-minute increments
60-minute increments

Answers

15-minute increments

To plan a pizza party, one may want to order enough pizza for everyone. Use the slicesPerPizza, slicesPerGuest, and totalGuests variables to compute the total number of pizzas needed to feed all the guests and store the result in pizzasNeeded. The total may have a decimal place.

Answers

Final answer:

To determine the total number of pizzas needed for a party, multiply the slices each guest will eat by the total guests and divide by the number of slices per pizza, rounding up if necessary.

Explanation:

To plan a pizza party and ensure everyone is fed adequately, you need to use a basic calculation to determine the total number of pizzas needed. If you're given the number of slices each pizza has (slicesPerPizza), the number of slices each guest will eat (slicesPerGuest), and the total number of guests (totalGuests), you can calculate the number of pizzas you need to order using the following code (in a programming language like Python, for example):

pizzasNeeded = (slicesPerGuest * totalGuests) / slicesperPizza

print ("Total number of pizzas needed:", pizzasNeeded)

This code will store the calculated number of pizzas in the variable pizzasNeeded. If the result includes a decimal, you should round up, as you can't order a fraction of a pizz. In practice, this might mean using a function like math.ceil() to ensure you're ordering enough pizzas.

Here's an example with real numbers:

slicesPerPizza = 8
slicesPerGuest = 3
totalGuests = 20
pizzasNeeded = math.ceil((slicesPerGuest * totalGuests) / slicesPerPizza)

This would compute the pizzasNeeded as 8 pizzas.

A system might help managers to

Answers

Answer:Decisions are only as valid as the information on which they are based. Management information systems improve your decision-making, because they provide information that is accurate, timely, relevant and complete.

Explanation:

Decisions are only as valid as the information on which they are based. Management information systems improve your decision-making, because they provide information that is accurate, timely, relevant and complete.

stuff = []

stuff.append("emu")
stuff.append("frog")
stuff.append("iguana")

print (stuff)
What data type are the elements in stuff?

Answers

Answer:

stuff [] is a Python Array.

stuff [] informs python that it is an array and it will create a variable in the memory. However, It doesn't inform anything about data type that being stored in it.

Following snippet

stuff.append("emu")

stuff.append("frog")

stuff.append("iguana")

This will add these element information to the end of the array.

When you print stuff then it will print all the elements of the array. So Now, elements in the array are of datatype string.

Explanation:

Answer:

Stuffffffff

Explanation:

STUFFFFFFFFFFFFf

What can be described as a measure of the amount of matter or material an object contains as well as taking gravitational pull into account?


density

volume

weight

mass

Answers

Answer:

The mass of an object is a measure of the object's inertial property, or the amount of matter it contains. The weight of an object is a measure of the force exerted on the object by gravity, or the force needed to support it. The pull of gravity on the earth gives an object a downward acceleration of about 9.8 m/s2.

does anyone go to holtville middle school

Answers

Answer:

nah

Explanation:

i go to homeschool now...

Answer:

No

Explanation:

I'm in AZ and I'm in distance learning! :)

What is FireWire?

a type of connector often used for real-time applications
a type of connector used for fiber optic cable
a type of connector used to connect devices to the serial port on a computer
a type of connector used for coaxial cable

Answers

Answer:

a type of connector used to connect devices to the serial port on a computer

Explanation:

A type of connector used to connect devices to the serial port on a computer

According to the Bureau of Labor Statistics, how
many new technical positions will be created in
the IT field by 2020?
One thousand
Ten thousand
One million
One billion

Answers

According to the Bureau of Labor Statistics, the number of new technical positions created in the IT field by 2020 is C. One million.

What is the Bureau of Labor Statistics?

The US Bureau of Labor Statistics is an agency that gathers, examines, and publishes labor, economic, and social data.

The agency gathers data about employment, compensation, worker safety, productivity, and price changes.

The Bureau of Labor Statistics is an attached office of the Ministry of Labor & Employment, established in 1920 to collect, collate, and disseminate labor, employment, and price statistics.

The bureau also computes and publishes the Consumer Price Index for Industrial, Agricultural, and Rural Laborers.

Thus, Option C is correct.

Learn more about the Bureau of Labor Statistics at brainly.com/question/28535251

#SPJ2

Which of the following is the amount of space available on a screen to display information?
a. bread crumbs
b.drop-down menus
c. screen real estate
d. tabbed menus

Answers

Answer:

C.) Screen real estate

Explanation:

It is the amount of space available on a display for an application to provide output.

PLEASE HELP Which of the following is considered a modern method of communication?

Hieroglyphics
Smoke signals
Tablet
Telegraphs

Answers

The answer would be telegraphs
Telegraphs because hieroglyphics were used by the ancient Egyptians and smoke signals are one of the oldest forms of long distance communication and clay tablets were used around 3000 years ago I believe so I think that telegraphs are considered a modern form of communication because it is the most recent made form out of all of the options

what input and output devices does a mainframe computer have?

Answers

Answer:

For instance, a keyboard or a mouse may be an input device for a computer, while monitors and printers are considered output devices for a computer. Devices for communication between computers, such as modems and network cards, typically serve for both input and output.

Explanation:

An example of an asset is:

A. Time
B. Money
C. A Car
D. All of the above

Answers

Answer:

D

Explanation:

All of these things have value in some sense. Time helps us keep track of, say, an important meeting. Cars help us get places in such a fast way. Money we literally require to pay for things in today's modern world. So therefore, all of these things are assets.

Next, Jemima designates the selected heading as Heading 1.
Which property of her headings can Jemima modify based on the Styles task pane?

Answers

Answer: both paragraph and font styles

Explanation:

c

What type of computer lies between micro and mainframe computer?

Answers

Answer:

Mini computer lie between micro and mainframe Computer.

Hope it will help you :)

What is FireWire?

a type of connector often used for real-time applications
a type of connector used for fiber optic cable
a type of connector used to connect devices to the serial port on a computer
a type of connector used for coaxial cable

Answers

Answer:

i believe its a type of connector used to connect devices to the serial port on a computer

Explanation:

7. Suppose you have a CPU that gets very hot and will be used in a noisy industrial building. How
would those factors affect your choice of coolers?​

Answers

Answer:

Personally, in a noisy building, a CPU cooler's noise level is

not something I would worry about.

would be the best choice.

Explanation:

I would get a cooler that

produces the most air flow to keep the CPU cool.

A fan that moves the most volume of air along with the best

coils and heatsink

would be the best choice.

If you have a CPU that gets very hot and will be used in a noisy industrial building, you would need to choose a cooler that is both effective at cooling the CPU and quiet enough to be used in a noisy environment.

What are some factors to consider?

The size of the CPU: Some coolers are designed for specific CPU sizes, so you will need to make sure that the cooler you choose is compatible with your CPU.

The noise level: As mentioned, you will need to choose a cooler that is quiet enough to be used in a noisy environment. Look for coolers that have a noise level of 20 decibels or less.

The type of cooler: There are two main types of coolers: air coolers and liquid coolers. Air coolers are less expensive and easier to install, but they are not as effective as liquid coolers. Liquid coolers are more expensive and require more maintenance, but they are more effective at cooling the CPU.

The budget: Coolers can range in price from around $20 to $200 or more. You will need to decide how much you are willing to spend on a cooler.

Find out more on CPU here: https://brainly.com/question/474553

#SPJ2

____enables you to temporarily hide all the open windows except the one you are viewing.

Answers

Answer:

well there is multiple ways to do that but the way i do it is swipe 4 fingers up on the mouse pad and it shows diffrent tabs.

Explanation:

HURYY PLEASE and please be the right answer!!!with reasoning
Which strategies can Carlos use to avoid frustration or burnout while studying for a test or working on a project? Check all that apply.

Study when rested.
Take breaks while studying.
Before beginning, ask for help from a tutor.
Get help early on from a teacher, parent, or friend.
Maintain the flow by not interrupting studying for any reason.

Answers

Answer:

- Study when rested

- Take breaks while studying

- Before beginning, ask for help from a tutor.

- Get help early on from a teacher, parent, or friend.

1,2,3,4

Explanation:

Completed quiz, Correct on EDGE.

? Assessment
27 IU
Which of the following statements about recommendation engines is FALSE?
A. An online recommendation engine
is a set of algorithms that uses past
user data and similar content data to
make recommendations for a specific
user profile.
B. An online recommendation engine
is a set of search engines that uses
competitive filtering to determine
what content multiple similar users
might like.
C. Both A and B are false
D. Neither A nor B are false
lol

Answers

Option C :Both A and B are false

Explanation:

An online recommendation engine  is a set of algorithms that uses past user data and similar content data to  make recommendations for a specific  user profile. It also uses  competitive filtering to determine  what content multiple similar users  might like.

They are typically composed of a hybrid of content and collaborative filtering procedures. They are used in a variety of software applications, including music playlist generation, movie choice, targeted advertisements, and restaurant recommendations.

So the option C is FALSE as both the options A as well as B are true

Users in the Engineering Department need a higher level of access on their local computers than other users do. In addition, you want to set power options on mobile computers that Engineering users use. All Engineering Department user and computer accounts are in the Engineering OU. What should you configure to meet the following criteria?
• When an Engineering user signs in to a computer, the user account is added to the local Administrators group on that computer.
• Enable the hibernation power mode but only if the user’s computer is identified as a portable computer. Set the power scheme to hibernate mode if the laptop’s lid is closed or the power button is pressed.

Answers

Answer:

I assume you don't need a answer anymore?

Explanation:

Hope goes through the steps of sorting a list. The resulting list is shown below.

Which step did Hope miss?
Press the Sort icon.
Sort the list by text.
Click the Header Row option.
Choose the Ascending button.

Answers

Answer:

Click the Header Row option.

Explanation:

Click the Header Row option is the step did Hope miss. Hence, option C is correct.

What is meant by Header Row?

Click anywhere on the table. On the Home tab of the ribbon, click the down arrow next to Table, then choose Toggle Header Row. — OR— On the Table Design tab, choose Header Row under Style Options.

Table headers are the rows at the top of a table that identify each column. The table below, for instance, has three columns with the headings "Name," "Date of Birth," and "Phone."

The grey row with the letters. used to identify each column in the spreadsheet serves as the column heading or column header in Excel and Sheets. The column header appears after row 1 in the worksheet.

Select the row you want to make the header for, then use the right-click menu to choose Table Properties. At the top of each page, select the Row tab and check Repeat as header row.

Thus, option C is correct.

For more details about Header Row, click here:

https://brainly.com/question/14479218

#SPJ2

What is one characteristic of good reference material?
a. It is provided by an anonymous source.
b. It is provided by a reliable source.
c. It is fictional.
d. It is out-of-date.

Answers

B.- it is provided by a reliable source.
B- by a reliable source

What type of camera is a cell phone camera

Answers

Answer:

A camera phone is a mobile phone which is able to capture photographs and often record video using one or more built-in digital cameras. It can also send the resulting image over the telephone function. The first commercial camera phone was the Kyocera Visual Phone VP-210, released in Japan in May 1999.

Explanation:

Hope this kinda helps you :)

Answer:The first camera phone was the Kyocera Visual Phone VP-210, released in Japan in May 1999. The camera had a 110,000-pixel front-facing camera.

Explanation:


What is the atomic number of neonWhat do the following results from the TEST FOR LIFE tab indicate about the sample

Answers

The atomic number for Neon is 10.

I do not see the info for the second part of the question

Hope fixes her mistake and comes up with this list.


She thinks it is a good idea to list the gases based on the amount of the gas found in the atmosphere from largest to smallest percentage.

Which options would she need to apply to do this? Check all that apply.

Use the Text option.

Use the Paragraph option.

Use the Header Row option.

Use the Descending option.

Use the Percentage Field option.
I have been waiting for 10 minutes can someone please help me

Answers

Answer:

C, D, E,

Explanation:

Use the header row option

Use the descending option

Use the Percentage field option

Other Questions
Which writing algebraic expression correctly translate 2n + 8 As of March 12, 2020 the yield to maturity on 30 year US Treasury Bonds was 1.44%. On the same date, the yield to maturity on 30 year TIPS (Treasury Inflation Protected Securities) was 0.31%. The latter can be viewed as a real interest rate. What forecast inflation rate is implied by these interest rates Please help me answer this What led to the Rwandan genocide? In November 1967, General Westmoreland told the American public that _____. Select all that apply. the United States was making progress in Vietnam the Vietcong were winning the war the war would be a drawn out, inconclusive war the end of the war was in sight Who ruled by divine right in France, extended that nation's borders, and built a palace at Versailles?PhilipPeter ILouis XIVCharles VWhich of the following monarchs had limited rule?Peter the GreatPhilip IIElizabeth ILouis XIVWhich absolute monarch toured western Europe for ideas on modernizing his nation and invaded other countries in order to secure warm-water ports?Prince FrederickLouis XIVCharles VPeter IWhich best explains the cause of the English Civil War?the spread of Protestantism in Englandthe persecution of Protestants by Catholicsthe execution of Charles Ithe conflict between the Stuart kings and ParliamentHow did the Glorious Revolution establish a constitutional monarchy in England?Charles II signed legislation limiting the power of the monarchy.Oliver Cromwell established a constitutional monarchy after winning the civil war.William agreed to sign the English Bill of Rights as a condition of becoming king.The Church of England forced James II to increase Parliament's power.Which astronomer designed scientific instruments, including a new kind of thermometer, an improved compass, and a more powerful telescope? He also discovered four moons orbiting the planet Jupiter. Galileo GalileiNicolaus CopernicusJohannes KeplerPtolemyWhich philosopher believed the path to new knowledge is by way of inductive reasoning?Isaac NewtonFrancis BaconRen DescartesAndreas VesaliusWhich British scientist is considered the father of modern chemistry because he identified the basic building blocks of matter and opened the way for modern chemistry?Antoine LavoisierAnton van LeeuwenhoekJoseph PriestleyRobert Boyle Suppose that the financial ratios of a potential borrowing firm take the following values: Working capital/Total assets ratio (X1) = 0.75 Retained earnings/Total assets ratio (X2) = 0.10 Earnings before interest and taxes/Total assets ratio (X3) = 0.05 Market value of equity/Book value of long-term debt = .60, X5 = Sales/Total assets ratio = 0.9. Calculate the Altmans Z-score for this firm. Round your answer to 3 decimal places. Sexual assaults typically happen because:A. The victim didn't clearly say soB. The perpetrator was drunk C. Someone believes they have the right to have sex, whether or not the other person consentsD. There was miscommunication Students set a goal of collecting 900 cans for the canned food drive. The number of cans they have collected so far is 82% of their goal. How many cans have they collected so far? The equilibrium price of a guidebook is $35 in the perfectly competitive guidebook industry. Our firm produces 10,000 guidebooks for an average total cost of $38, marginal cost of $30, and average variable cost of $30. Our firm should:a) raise the price of guidebooks, because the firm is losing money.b) keep output the same, because the firm is producing at minimum average variable cost.c) shut down, because the firm is losing money.d) produce more guidebooks, because the next guidebook produced increases profit by $5. HELPPPPPPPP! 50 points for whoever writes the best letter and brainliest! Please helpppImagine that you are Atticus Finch writing a business letter to the judge to explain the reason you are appealing Tom'sconviction. Following the format below, write a five-paragraph letter that details the evidence that proves Tom'sinnocence, and the evidence that is lacking in order to convict him. Use examples from the text, as well as correctgrammar, spelling, and punctuation.^ go back up and help meeeeeeeeeeeeeeee The circumference of a circle is 36 feet. What is the length of the radius of this circle?A. 9 ftB. 18 ftC. 36 ftD. 72 ftPlease answer now! When 3 is taken from five times a certain number, the result is the same as adding 6 to twice the number. Find this number An embankment is best defined as __________. A. the process of cutting down all of the trees and plant life in an area, with no care given to the sustainability of the forest B. the process of farming fish or other marine animals so they can be used as a food source C. a stretch of raised land, often built to help control flooding and the flow of a river D. gray or brown particles that cloud the air and that are caused by dust, smoke, or pollution Please select the best answer from the choices provided 5. Alisha's average math test score was 82. Which of the following students has the same averagemath test score as Alisha?F. Jenny earned 492 points on 6 tests.G. Frankie earned 352 points on 4 tests.H. Benicio earned 468 points on 6 tests.1. Dontonio earned 344 points on 4 tests.(20 Points) NAFTA led to the decrease of food and oil prices. How did this impact Texas? a. It increased jobs. b. It strained the budget of American families. c. It hurt producers. d. It decreased economic growth along the border. In a demonstration of strong electrolytes, weak electrolytes, and nonelectrolytes, Professor Popsnorkle used a lightbulb apparatus that showed how much a solution conducted electricity by the brightness of the lightbulb. When pure water was tested, the bulb did not light. Then Professor Popsnorkle tested the following aqueous solutions. Which one caused the bulb to burn the brightest? a. ethanol, CH3CH2OH b. methanol, CH3OH c. table salt, NaCl d. table sugar, C12H22O11 e. acetic acid, CH3COOH The ____ is the first eight lines of an ____.First blank -sestet-octave -quatrainSecond blank -Italian Sonnet-English sonnet Please help me? IF I DOG WALK AND FOR EACH DOG I MAKE $15 HOW MANEY DOGS DO I HAVE TO WALK TO GET $100 A solution that contains the maximum amount of solute for a given amount of solvent at a particular temperature is called