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: arg1 post == arg2 pre && arg2 post == arg1 pre
void swap( int & lhs, int & rhs)int temp = lhs;
lhs = rhs;
rhs = tmp;
```

Computer Science & Information Technology

You might also like to view...

Participants in the Putt for Paws tournament will be stored in the database. This is an example of a(n) ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

A 20-page print job is started, but the pages are gibberish. Which of the following will not help solve the problem?

a. Pause, then continue the print job b. Clear the print queue, then start the print job c. Check the printer driver d. Check the printer cable or data connection

Computer Science & Information Technology

Internet Information Services is a web service utilized by the _______________ operating system

a. Unix b. Linux c. Windows d. IIS is platform-independent.

Computer Science & Information Technology

The label Souvenir Shop is in cell A1, and April Sales Report is in cell B1. You select the range A1:E1 and click Merge & Center. What is the result?

What will be an ideal response?

Computer Science & Information Technology