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
Harman [31]
3 years ago
8

Assume that a function named swapdoubles has been defined and is available for use in this exercise: that function receives two

variables of type double and exchanges their values. Write the definition of a function named sort3 that is passed three double variables. The function returns nothing but modifies the values of these variables so they are in sorted order. So, if a, b and c have (respectively) the values 3.14, 2.71, and 3.04, and the invocation sort3(a,b,c) is made, then upon return, the values of a, b and c will be 2.71, 3.04, and 3.14 respectively.
Computers and Technology
1 answer:
Nata [24]3 years ago
6 0

Answer:

C++ Code:

void sort3(double &a, double &b, double &c)

{

   if(a > b)

       swapdoubles(a,b);

   if (b > c)

       swapdoubles(b,c);

   if (a > b)

       swapdoubles(a,b);

}

Explanation:

To change the values of a,b,c within the function, we pass the values by reference. Let us assume that number a = 3.14, b = 2.71, c = 3.04. Since a > b, values of a and b will be swapped.Now a = 2.71 and b = 3.14. Similariy, since b > c, they will be swapped. This way, we move the largest number to its correct position in the first two steps. If there are only three numbers, and the largest number is in its correct position, then for the two remaining numbers, we will only need atmost one swap to exchange their positions. hence, we perform a comparison of a > b once again to see if the b is smaller than a. if its not, then all a,b,c are in sorted order.

You might be interested in
Is it true that if the user log out the computer will turn off automatically​
sergiy2304 [10]
Yes that is a true statement
8 0
3 years ago
Read 2 more answers
Approximately how long did it take, in minutes, for the body to return to normal after the intake of water.
labwork [276]

Answer:

30

Explanation:

it takes 30 minutes to digest

5 0
3 years ago
What do u call a individual that loves motor bikes and leather and is in a rival group known as mods?
vladimir1956 [14]
My best guess would be a biker they love motor bike they wear leather jackets and ride in groups this is the only thing i could think of

~ thanks ~
7 0
3 years ago
What is 2D thinking and 3D thinking? i literally don't understand
andriy [413]

Answer:

Two dimensional thinking implies concepts that are flat or only partially representative of the whole. Three dimensional thinking implies the first part of 2d thinking conjoined with intersecting dimensions rendering a deeper field of meaning.

Explanation:

8 0
3 years ago
Which of the following are the dimensions of feasibility? Group of answer choices cost, schedule, technical, and organizational
Paha777 [63]

Answer:

"cost, schedule, technical, and organizational feasibility schedule" is the correct option.

Explanation:

A technical feasibility is the study of the concerned about the specifying software and tools which satisfy the users' need. It is also the process of thinking for which business technologies are important to bring labours, transportation, and materials.

An organizational feasibility is the study of the information of the professional background and about the skills which are necessary for the contribution in the business.

7 0
3 years ago
Other questions:
  • A web page created expressly in hopes of ranking well for a term in a search engine's organic/non-paid listings and which itself
    7·1 answer
  • How can you add and remove categories from a previously created chart? A. Click the Format tab. B. Click the Chart Styles button
    13·2 answers
  • A technician removes the cap from the brake fluid reservoir and finds that the rubber boot in the cap is swollen. technician a s
    8·1 answer
  • By
    7·1 answer
  • A group of users is unable to connect to the network. When testing several of the PCs and issuing the command ipconfig, the tech
    10·1 answer
  • Dominic's teacher asked him to create a chart or graph to compare the different grade levels in the school's FBLA club. Which ch
    5·2 answers
  • Multiple choice:
    12·2 answers
  • It is a data being transported on a network​
    13·1 answer
  • ______________ are used to store information that will be referenced and manipulated in a computer program. They label data with
    6·1 answer
  • From which os did windows xp evolve?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!