Answer:
RecursiveCalls.backwardsAlphabet(startingLetter);
Explanation:
The statement that is needed is a single-line statement. Since the class RecursiveCalls is already in the same file we can simply use that class and call its function without making a new class object. Once we call that class' function we simply pass the variable startingLetter (which is already provided) as the sole parameter for the function in order for it to run and use the letter 'z' as the starting point.
RecursiveCalls.backwardsAlphabet(startingLetter);
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.