//Cameron Pham      		    CS1A                       Chapter 9, p. 538, #5
//
/******************************************************************************
* DROP LOWEST SCORE
* ______________________________________________________________________________
* This program accepts an integer value and modifies their values. The function 
* multiplies each original value by 10, exchanges their positions, and returns 
* the sum of the modified values. 
* 
* INPUT
* Integers					// The integer values inputted
* 
* OUTPUT
* X							// New value of first integer
* Y							// New value of second integer
* Sum						// Sum of modified values
*******************************************************************************/
#include <iostream>
using namespace std;

// Function prototype
int doSomething(int* x, int* y);

int main()
{
    int num1, num2;
    int result;
    // Get two integers from the user
    cout << "Enter the first integer: ";
    cin >> num1;
    cout << "Enter the second integer: ";
    cin >> num2;
    // Call the function using the addresses of the variables
    result = doSomething(&num1, &num2);
    // Display the modified values and returned result
    cout << "\nFirst integer: " << num1 << endl;
    cout << "Second integer: " << num2 << endl;
    cout << "Returned value: " << result << endl;
    return 0;
}
// Multiply and exchange the values using pointers
int doSomething(int* x, int* y)
{
    int temp = *x;
    *x = *y * 10;
    *y = temp * 10;
    return *x + *y;
}