Arrays Topic question

Dec 8, 2008 at 5:52pm
My question is this

Week 13 Lab

A lottery ticket buyer purchases 10 tickets a week, always playing the same 10 4-digit lucky combinations. Write a program that initializes an array with these numbers and then randomly determines this weeks winning 4 digit number. The program should perform a linear search through the list of the player’s numbers and report whether or not one of the tickets is a winner this week. Here are the numbers:

1357
2678
2679
3344
5555
6248
7777
7942
8564
9312

Initially test your program by assigning 7777 as the winning number.
Once you have determined that your program works properly, create a function that returns a randomly generated winning number. That function will need to randomly generate each single digit. Once you have the 4 single digits, you will then need to devise a way to construct the 4 digit number and return it.


i know i have to create a function like

(rand()% 9,000)+1000

0-8,999+1000

i know this much but if somebody can help me with the source code liitle bit it might help

plz reply to this forum or to my email

hotneeraj007@gmail.com
Dec 9, 2008 at 2:28am
Just a heads up most people are not just going to give you code, but if you post what you have so far you will get replies pretty quick.
Topic archived. No new replies allowed.