473,507 Members | 4,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

lootery ball progam

Has any body got any code for this brief that a friend has to do, its
for the uk version of the lottery i.e 6 balls and a bouns ball.

1. a control loop is required to determine the operation required by
the user
2. use of a switch structure to execute required operation
3. read old draw data from file into arrays on programme start up
4. allow the user to enter the latest data
5. allow the user to modify existing draw data
6. view draw data for a selected week given the date of the draw or
week number
7. save the draw dta from arrays to the file on programme exit
8. the programme must validate that the ball numbers input are in the
correct range (between 1 and 49) and no duplicates.
Thanks
Jul 22 '05 #1
5 1632

"carl bloc" <ca****@tesco.net> wrote in message
news:8c**************************@posting.google.c om...
Has any body got any code for this brief that a friend has to do, its
for the uk version of the lottery i.e 6 balls and a bouns ball.

1. a control loop is required to determine the operation required by
the user
2. use of a switch structure to execute required operation
3. read old draw data from file into arrays on programme start up
4. allow the user to enter the latest data
5. allow the user to modify existing draw data
6. view draw data for a selected week given the date of the draw or
week number
7. save the draw dta from arrays to the file on programme exit
8. the programme must validate that the ball numbers input are in the
correct range (between 1 and 49) and no duplicates.


Show the code that you have already written, and someone will be able to
help you with it (assuming you can frame a coherent question, something that
some posters seem to have trouble with). We don't do you homework for you.

john
Jul 22 '05 #2
carl bloc writes:
Has any body got any code for this brief that a friend has to do, its
for the uk version of the lottery i.e 6 balls and a bouns ball.

1. a control loop is required to determine the operation required by
the user
2. use of a switch structure to execute required operation
3. read old draw data from file into arrays on programme start up
4. allow the user to enter the latest data
5. allow the user to modify existing draw data
6. view draw data for a selected week given the date of the draw or
week number
7. save the draw dta from arrays to the file on programme exit
8. the programme must validate that the ball numbers input are in the
correct range (between 1 and 49) and no duplicates.


That sounds like a very specialized program written for only one user, the
manager of the UK lottery. Also it seems to work for only one year, which
bothers me because of the "seam" problem, in other words it would have to be
a _running_ year. The suggestions below generalize the problem to work for
several years. In view of the specialized nature it seems unlikely that
anyone has such a brief lying around. I suggest your friend start by giving
some tentative data definitions. I note that you have posted a similar
question to comp.lang.c and the solution there might be quite different.
Your friend should start by enquiring of the British Government if they will
accept a solution in either language.

He might think about a data structure along these lines.

#include <time>

struct Draw
{
int ball[6]; // 1..49
int bonus; // 1..49 ??
time_t date_stamp; // probably will be a long. FYI only
};

The file would consist of several of these Draw records. As such it (the
file) would be an archive if you ignore the quibble that some person is
entitled to modify the archive according to his whim..

Modify as necessary and start writing some code, simplest thing first. If
you can't decide what is simplest toss a coin eight times. If after several
minutes you wish the coin toss had come out differently, toss the coins
again and have another go.

That is working towards a C oriented solution but using C++ syntax.

Compile often. Actually link and run frequently - but less often.

It sounds like fun, tell him to get started. (I assume it is a he)
Jul 22 '05 #3
ca****@tesco.net (carl bloc) wrote in message news:<8c**************************@posting.google. com>...
[blatant homework request redacted]


You know, these guys make it easy for us to ID homework. If they
said, "I want help with a lottery program", then maybe it's OK. But
when it says *HOW* to implement, that's clearly homework.

Any requirement specification tells says what to do. The details of
the implementation are undefined. When you start saying, "I want to
do X, and it has to be done by A, B, and C", then you know you are
dealing with homework.
Jul 22 '05 #4

"red floyd" <re********@yahoo.com> wrote in message
news:96************************@posting.google.com ...
ca****@tesco.net (carl bloc) wrote in message

news:<8c**************************@posting.google. com>...
[blatant homework request redacted]


You know, these guys make it easy for us to ID homework. If they
said, "I want help with a lottery program", then maybe it's OK. But
when it says *HOW* to implement, that's clearly homework.

Any requirement specification tells says what to do. The details of
the implementation are undefined. When you start saying, "I want to
do X, and it has to be done by A, B, and C", then you know you are
dealing with homework.


I don't mind helping with homework at all. Its when the request is 'do my
homework for me' that I object.

john
Jul 22 '05 #5
John Harrison wrote:
I don't mind helping with homework at all. Its when the request is 'do my
homework for me' that I object.

The same message was posted over on comp.lang.c, so the googer doesn't
even know what language the problem should be done in.


Brian Rodenborn
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1467
by: MV | last post by:
Hi, I want to try and get a lottery type script to run in these two browsers before i put it on my site. It runs OK in I.E.6 and my friend says it works in netscape 7 so i can't see the problem...
1
2248
ilikepython
by: ilikepython | last post by:
Hi, I made a pong game with pygame. It works pretty good but I want the ball to bounce realistically. Just like in real pong when it bounces off the right edge it goes to the right and when it...
0
1344
by: fabien.lyon | last post by:
-----Message d'origine----- De : fabien.lyon Envoyé : mercredi 30 mai 2007 20:16 À : 'python-list@python.org' Objet : RE: embeded python progam into visual C++ application crash 2.5.1 is...
7
3958
by: Bigs | last post by:
Source: http://fileho.com/download/120846695042/bounce2.zip.html How would I go about making a wall for my bouncing ball? For example if the ball hit the center box it would bounce.
1
2625
by: sake | last post by:
Dear All, I'm working on a 3d breakout game in C++, and I'm having a little trouble with the collision. It will detect that the ball has hit the paddle just fine, but after that, how do I determine...
2
1758
by: SilentCodingOne | last post by:
I have a application where each time you click the add ball button a new randomly colored ball is added to the jpanel. It works fine except that the balls suddenly stop at the same spot. I want them...
0
1948
by: andreachilam | last post by:
I am doing a project of creating a playing pool and 2 balls bouncing within the pool. I have tried to use "while loop" and "if statement" to set restriction limiting the ball not to bounce out of the...
0
7220
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7308
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7371
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7023
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5617
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3178
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1534
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
410
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.