Help me!

How do I write void arrange?
and how do I declare dispValues?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include <iostream>
using namespace std;

void askValues(int x,int y,int z);
void arrange(int &x, int &y, int &z, int max, int mid, int min, int);

int main(){

int x,y,z;

// The function below asks 3 numbers from the user
	askValues(x,y,z);

// The function below rearranges the values based on the 4th
// argument. If the 4th argument is 1 sort the numbers from
// lowest to highest, if the 4th argument is 2, sort the
// numbers from highest to lowest
	arrange(x,y,z,1);

// The function below displays the values of the 3 numbers
// and the string passed as the 4th argument. Refer to the
// sample dialogues section below
// for the format
	dispValues(x,y,z, "lowest to highest: ");
	arrange(x,y,z,2);
	dispValues(x,y,z, "highest to lowest: ");

return 0;
}

void askValues(int x,int y,int z){
	cout << "Type 3 numbers: ";
	cin >> x >> y >> z;
}

void arrange(int &x, int &y, int &z,int max, int mid, int min){
        if (x > y && x > z && y > z)
       x = max;
       y = mid;
       z = min;
}

Last edited on
Topic archived. No new replies allowed.