Ok ive finished the coding, but have 1 issue im trying to get around. because i'm calling on the function numGen 2 times for the console display and the file export its generating 2 different outputs. how can i reformat some of my code to get exactly what im doing across but with the same output to the textfile as the console.
It's also outputting to he console the ticket frame perfectly but then a second set of numbers from the ticketFrameFile function calling on numGen again, and if you look in the text file after running the program the ticket frame is there perfectly without the lottery numbers....
The outfile within numGen is not the same filestream. You are trying to write data to a file stream that is not connected to the file. You'll have to pass the file stream to numGen as a reference. Also when you call ticketFrameConsole() you are also outputting data to cout and the file stream which you never opened any file with. Each file stream object is a completely different object in your program. It is hard for me to tell you how to fix this since you are so limited in what you are allowed to do. I would make numGen a template function personally.
I changed your program in some places. I'd like to write it from the beginning myself, because these version gets more complicated, because of your mistakes with calling numGen twice. On the other hand, I don't want to write whole program for you, because it'd be my way of thinking. This is a little crappy for me :P
If you're going to write programs in the future, at the beginning you should think about sectioning them into functions more clever. Every function should have its own task. One to print sth, another to make loops, etc.
Ok. I think we are looking good now. It seems to work as planned. Anything else jump off the page that is out of the ordinary? Thanks for your help Kempofighter and mtweeman
Looks like we posted new programs pretty much at the same time. I see where you made some changes, i also made some changes of myself to simplify what i had. Hows my new way look before i consider going back and looking further at some of your ideas...?
if you have program in this shape, think about sharing it into pieces yourself, it looks good for me. make function numFrameFile which will save data in file, numTicket which will generate ticket random number, numNumbers which will generate lottery numbers and one or two functions to print some info on the screen and into file, ex. "New Jersey lottery" as you wrote.