Lottery Tickets

1. Read in the 6 numbers that were announced in the order that they were announced. You will have 6 different numbers ranging from 1 to 54 which can be entered in any order (not sequential) and each number can only appear once.

2. Sort the 6 numbers in ascending order so that they will be easy to compare to your numbers. Display the sorted list of numbers

3. Set up a two dimensional array to hold the numbers that you play every week. The rows in the array will hold one group of numbers that you play. There will be 10 rows and 6 columns in the array.

4. Loop through the array to see if this week's lottery numbers match any of the ones that you normally play. If you find a match - display "You're a WINNER!!!". If there is no match, display "Better luck next week"

Need some help on how to do these specific tasks. I have done 2 already but I dont understand how to do 1.

These are the numbers for the array
8, 15, 28, 29, 48, 54
10, 16, 33, 42, 44, 51
5, 7, 8, 14, 21, 29
10, 32, 34, 42, 47, 54
11, 21, 27, 28, 37, 38
1, 12, 23, 34, 45, 54
7, 11, 22, 33, 44, 50
8, 17, 29, 35, 43, 45
1, 3, 5, 7, 9, 11
2, 4, 6, 8, 10, 12

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
44
45
46
47
48
49
50
51
52
53
54
55
  #include <iostream>

using namespace std;

void selectionSort(int [], int);
void showArray(const int [], int);

int main()
{ 
const int size = 6;
int values[size] = {};

cout << "6 numbers\n";
showArray(values, size);

selectionSort(values, size);

cout << "the sorted values are\n";
showArray(values, size);






system ("pause");
return 0;
}
	void selectionSort(int Array[], int size)
{
	int startScan, minIndex, minValue;

	for(startScan = 0; startScan < (size - 1); startScan ++)
{
		minIndex = startScan;
		minValue = Array[startScan];
	for(int index = startScan + 1; index < size; index++)
{
	if (Array[index]< minValue)
{
		minValue = Array[index];
		minIndex = index;
	}
}
		Array[minIndex] = Array[startScan];
		Array[startScan] = minValue;
	}
}

	void showArray(const int array [], int size)
{
		for (int count = 0; count < size; count++)
		cout << array[count] << " ";
		cout << endl; 
	}
Topic archived. No new replies allowed.