Help make a lottery program.

Hello!
I'm fairly new to c++, and I need some help to get started on my latest assignment. The task is as follows:

Write a C++ app that randomize 10 lottery lines and stores them in a file. The lottery lines should be sorted in a rising fasion. One lottery line consists of seven unique numbers between 1 to 35.

The application must contain the following:
1. A program loop that keeps the program going until the user chose to close it.
2. Atleast one list for storing of data (i.e a vector).
3. One function used to randomize a new lottery line.
4. One function that gives prompts for a filename and saves the lottery lines in the file.
5. A function that gives prompts for filename and reads the lottery lines from the file.
6. A function that presets all ten lottery lines on the screen.


Any help is greatly appreciated, as I really don't know how to go about this task.
This is the format I use for most new programs.
I named it new.cpp and load it to start making any new app.
It simply saves typing to do some common task but will get you started with functions.


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
#include <conio.h>
#include <cstdlib>
#include <dos.h>
#include <fstream>
#include <iostream>
#include <stdlib.h> 
#include <stdio.h> 
#include <string.h> 
#include <time.h>
#include <windows.h>

using namespace std;


// ifstream InputFile ( "in.txt" );
// ofstream OutFile ( "out.txt" );

string data;


void Function1()
{
cout << "Function 1" << endl;
}

void Function2()
{
cout << "Function 2" << endl;
}

void Function3()
{
cout << "Function 3" << endl;
}

void Function4()
{
cout << "Function 4" << endl;
}


int main()
{
Function1();
Function2();
Function3();
Function4();

// InputFile.close();
//OutputFile.close();
return 0;
}
i dont really see the time saved there
i still need to set the datatype of the functions and their names. and if i use less then these 4 and the included headers, i even need to delete stuff
and there is using namespace std in it
Last edited on
Topic archived. No new replies allowed.