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
Ivahew [28]
2 years ago
14

5.8.1: Modify an array parameter. Write a function SwapArrayEnds() that swaps the first and last elements of the function's arra

y parameter. Ex: sortArray = {10, 20, 30, 40} becomes {40, 20, 30, 10}. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #include using namespace std; /* Your solution goes here */ int main() { const int SORT_ARR_SIZE = 4; int sortArray[SORT_ARR_SIZE]; int i; int userNum; for (i = 0; i < SORT_ARR_SIZE; ++i) { cin >> userNum; sortArray[i] = userNum; } SwapArrayEnds(sortArray, SORT_ARR_SIZE); for (i = 0; i < SORT_ARR_SIZE; ++i) { cout << sortArray[i] << " "; } cout << endl; 1 test passed All tests passed Run

Computers and Technology
1 answer:
viktelen [127]2 years ago
3 0

Answer:

see explaination

Explanation:

#include<stdio.h>

/* Your solution goes here */

//Impllementation of SwapArrayEnds method

void SwapArrayEnds(int sortArray[],int SORT_ARR_SIZE){

//Declare tempVariable as integer type

int tempVariable;

if(SORT_ARR_SIZE > 1){

tempVariable = sortArray[0];

sortArray[0] = sortArray[SORT_ARR_SIZE-1];

sortArray[SORT_ARR_SIZE-1] = tempVariable;

}

}

int main(void) {

const int SORT_ARR_SIZE = 4;

int sortArray[SORT_ARR_SIZE];

int i = 0;

sortArray[0] = 10;

sortArray[1] = 20;

sortArray[2] = 30;

sortArray[3] = 40;

SwapArrayEnds(sortArray, SORT_ARR_SIZE);

for (i = 0; i < SORT_ARR_SIZE; ++i) {

printf("%d ", sortArray[i]);

}

printf("\n");

return 0;

}

Please go to attachment for the program screenshot and output

You might be interested in
Select all that apply.
Leto [7]
You may do all of the given options.
Thank You!
8 0
3 years ago
Sketch f(x) = 5x2 - 20 labelling any intercepts.​
Norma-Jean [14]

Answer:

  • The graph of the function is attached below.
  • The x-intercepts will be: (2, 0), (-2, 0)
  • The y-intercept will be: (-20, 0)

Explanation:

Given the function

f\left(x\right)\:=\:5x^2-\:20

As we know that the x-intercept(s) can be obtained by setting the value y=0

so

y=\:5x^2-\:20

switching sides

5x^2-20=0

Add 20 to both sides

5x^2-20+20=0+20

5x^2=20

Dividing both sides by 5

\frac{5x^2}{5}=\frac{20}{5}

x^2=4

\mathrm{For\:}x^2=f\left(a\right)\mathrm{\:the\:solutions\:are\:}x=\sqrt{f\left(a\right)},\:\:-\sqrt{f\left(a\right)}

x=\sqrt{4},\:x=-\sqrt{4}

x=2,\:x=-2

so the x-intercepts will be: (2, 0), (-2, 0)

we also know that the y-intercept(s) can obtained by setting the value x=0

so

y=\:5(0)^2-\:20

y=0-20

y=-20

so the y-intercept will be: (-20, 0)

From the attached figure, all the intercepts are labeled.

8 0
2 years ago
You are an inventor. You are taking out an ad in a newspaper because you want people to buy/use your product/invention. Include
goldenfox [79]
The light bulb is important because it helps you see in the dark.

The light bulb is a round object that produces light from energy.

People can't live without the light bulb because it helps you out a lot such as see in the dark like when you do homework at night.

It could help businesses profit because many will want to buy it cause they can be cheap but many will sell and it could help you a lot!
4 0
3 years ago
What can help establish the focus and organization it relies on? A) Plan B) programming C) organizing D) arranging
serg [7]

Organizational communication helps us to

1) accomplish tasks relating to specific roles and responsibilities of sales, services, and production

2) acclimate to changes through individual and organizational creativity and adaptation

3) complete tasks through the maintenance of policy, procedures, or regulations that support daily and continuous operations

4) develop relationships where “human messages are directed at people within the organization-their attitudes, morale, satisfaction, and fulfillment”

5) coordinate, plan, and control the operations of the organization through management.

So the answer is C.

hope it helps!

7 0
3 years ago
Read 2 more answers
Which of the descriptions listed below best describes the step in the reverse engineering process called functional analysis? A)
Zepler [3.9K]
If multiple choice then d and a if not then the best one would be a!


hope this helps!!
5 0
2 years ago
Other questions:
  • What would be some long- term goals.
    11·1 answer
  • SOMEONE PLZZ HELP ME ASAP!!
    15·2 answers
  • What is the result when you run the following program?
    12·1 answer
  • Discuss the types of data that business might collect and how the business could use that data to drive decision-making in a spe
    15·1 answer
  • In an oblique drawing, which lines can be measured accurately, if there is no foreshortening?
    10·1 answer
  • What is a header row?
    8·1 answer
  • How can i fix a all white phone screen
    11·2 answers
  • What is the purpose of the ISOWEEKNUM function? determines how many workdays are in a certain week determines how many workdays
    12·2 answers
  • How does social network use message to entertain?
    14·1 answer
  • Which type of information should never be given out on social media?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!