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]
3 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]3 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
Bernard has a visual disability. Which type of assistive technology would he use to access print on the chalkboard or overhead s
dusya [7]

Answer:

a tactile input device

Explanation:

Based on the scenario being described it can be said that the best assistive technology for Bernard would be a tactile input device. Such a device would allow Bernard to physically interact with the print on the chalkboard or overhead screen from the device itself without having to actually get close to the chalkboard or screen. Thus allowing him to view its content from the palm of his hand.

8 0
3 years ago
I WILL GIVE BRAINIEST ANSWER AND THANKS IF YOU ANDWER THIS QUESTION!!!!
sesenic [268]
Access: full electronic participation in society.
Commerce: electronic buying and selling of goods.
Communication: electronic exchange of information.
Literacy: process of teaching and learning about technology and the use of technology.
Etiquette: electronic standards of conduct or procedure.
Law: electronic responsibility for actions and deeds.
Rights & Responsibilities: those freedoms extended to everyone in a digital world.
Health & Wellness: physical and psychological well-being in a digital technology world.
Security (self-protection): electronic precautions to guarantee safety.

IMPORTANT
Etiquette. Students need to understand how their technology use affects others. ...
Literacy. Learning happens everywhere. ...
Rights and responsibilities. Build trust so that if something happens online, students are willing to share their problems or concerns about what has happened.
6 0
3 years ago
How to Ctrl + shift + F4 but in a HP laptop?​
ludmilkaskok [199]

Answer:

Hit the X Button Located on the top right corner or hit Control, Alt, Delete

Explanation:

Hitting the X button will make you exit the whole cite, or hitting Control, Alt, Delet, will make you go to the task bar, in which you can go to the bottom right of that screen and it should say end task

3 0
3 years ago
Read 2 more answers
_____ returns the smallest integer greater than or equal to 7.3
Artist 52 [7]

Answer:

Explanation:

Required

Which returns smallest integer greater than or equal to 7.3

i.e.

x \le 7.3

When executed, the result of each instruction is:

ceil(7.3) = 8 -- This returns the smallest integer greater than 7.3

floor(7.3) = 7 --- This returns the smallest integer less than 7.3

<em></em>larger(7.3)<em> --- there is no such thing as larger() in python</em>

round(7.3) = 7 --- This rounds 7.3 to the nearest integer

From the above result,

8 is the smallest integer greater than or equal to 7.3

i.e.

8 \ge 7.3

Hence:

ceil(7.3) is correct

5 0
3 years ago
Step of opening browser on computer​
Katena32 [7]

Regardless of which version of Windows you have, you can also open the browser from the start menu. Select the start button and type in Chrome. If the Chrome browser is on your computer, it will be displayed in the menu, where you can now see the icon and select it to open.

                                   <3

3 0
2 years ago
Other questions:
  • 3. The following code will not display the results expected by the programmer. Can
    12·1 answer
  • I WILL MARK BRAINLIEST PLZ HELP
    5·1 answer
  • Over the past three hours the pressure has been steadily increasing at a rate of what
    6·1 answer
  • What are the five types of alignment in Word?
    12·2 answers
  • Explain the difference between the legal protections a security officer enjoys and the legal protections a police officer receiv
    12·2 answers
  • You are system administrator with hundreds of host workstations to manage and maintain. You need to enable hosts on your network
    14·1 answer
  • Compare entertainment applications to social media applications.
    5·2 answers
  • QUESTION 56 Use the Windows ________ to check on a nonresponsive program. Backup utility Error-checking System Restore Task Mana
    6·1 answer
  • Name two materials that we can burn in order to get energy from biomass
    9·1 answer
  • The illustration shows different types of text language.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!