Write a void function using two type int call-by-reference parameters that swaps the values in the arguments. Be sure to include testable pre and post conditions.

What will be an ideal response?


```
//precondition: arguments arg1, arg2 are initialized
//postcondition: arg1post == arg2pre && arg2post == arg1pre
void swap( int & lhs, int & rhs)
{
int temp = lhs;
lhs = rhs;
rhs = tmp;
}
```

Computer Science & Information Technology

You might also like to view...

Which of the following is false?

a. break and continue statements alter the flow of control. b. continue statements skip the remaining statements in current iteration of the body of the loop in which they are embedded. c. break statements exit from the loop in which they are embedded. d. continue and break statements may be embedded only within iteration statements.

Computer Science & Information Technology

A ____________ property can be set to one of two possible values: True or False.

a. Boolean b. Binary c. Singular d. Toggle

Computer Science & Information Technology

Which of the following is the correct way to set a background color of blue to an HTML element with id = "color_change"?

a. ``` document.getElementById("color_change").style.background = "blue"; ``` b. ``` document.getElementById("color_change").innerHTML = "blue"; ``` c. ``` ``` document.getElementById("color_change").style = blue(this.id); d. ``` document.getElementById("color_change").this.id = background("blue"); ```

Computer Science & Information Technology

What type of network is a private network that can also be accessed by authorized external customers, vendors, and partners?

A. extranet B. intranet C. enterprise network D. guest network

Computer Science & Information Technology