Horse Racing Visual studio Stage B and C only
STAGES
The assignment is divided into stages, and must be completed in the order shown. You
are not required to complete the stages for B or A grades, but if you do not do so your
best grade will be a C. You may submit incomplete work which may gain you some
marks.
The 3 stages are outlined here, but more detail follows.
All code is expected to follow the programming standards for Foundation Programming.
C STAGE
Satisfactory completion of this stage will result in your gaining a C grade (10 to 12 marks)
for the assignment. Requirements
1. This stage must be done individually.
2. Write a program in C# or other approved language that meets the specifications listed
in Appendix 1.
3. Documentation must include your log with test results and a reflection.
B STAGE
Satisfactory completion of this stage will result in your gaining a B grade (13 to 15 marks)
for the assignment. Requirements
1. This stage must be done individually.
2. Complete the C stage outlined above.
3. Write a program in C# or other approved language that meets the specifications listed
in Appendix 2. This is an extension of the C stage.
4. Documentation must include your log with test results and a reflection.
A STAGE
Satisfactory completion of this stage will result in your gaining an A grade (16 to 20
marks) for the assignment. Requirements
1. Satisfactorily complete the C and B stage work outlined above and have them checked
by your tutor.
2. Write a program in C# or other approved language that meets the specifications listed
in Appendix 3. This is a GUI version of the C and B stages.
3. Documentation must include your log with test results and a reflection.
4. This may be done individually, or as a pair. If working as a pair, pair programming must
be used and included in your log.
Notes
This stage gives you scope to explore aspects of programming you may encounter in
programming papers later in your student life, such as the graphical user interface (GUI).
Other examples include:
i. Appropriate use of methods.
ii. Using separate classes.
iii. Acceptance tests.
APPENDIX 1 – C STAGE SEMESTER 1 2016
INTRODUCTION
Horse racing, the so called “sport of
kings”, has been around since ancient
times in various forms, chariot racing in
ancient Rome being just one example.
According to Wikipedia, “Horse racing is
a significant part of the New Zealand
economy”. The
AucklaMarch, is one example of a major
race nd Cup, run at Ellerslie in in New Zealand. http://www.teara.govt.nz/en/horse-and-greyhoundracing
Historically, races have been measured in miles and furlongs (8 furlongs to a mile). This
assignment gives you the opportunity to simulate horse races for up to 10 horses over a
range of distances measured in furlongs.
REQUIREMENTS
Your program should
1. allow the user to name from 2 to 10 horses for a race.
2. allow the user to choose the length of the race in furlongs from 6 to 20.
3. allow the user to start the race.
4. use random numbers to specify which horse wins the race (see note).
5. display the names of the horses who come first, second and third in the race, responding
in a suitable way for a 2 horse race.
Note
Each horse must have one random number generated per furlong of the race, the numbers
being added. So for example in a 6 furlong race, 5 horses may have numbers generated as
follows:
Horse F1 F2 F3 F4 F5 F6 Total
One 3 8 5 6 4 1 27
Two 7 5 6 8 2 9 37
Three 5 7 6 2 9 1 30
Four 8 7 6 4 5 8 38
Five 3 4 6 2 3 1 19
One this basis, horse Four wins, horse Two is second and horse Three is third.
Course References
The extra challenge in Unit 5 shows how to generate random numbers.
Arrays were mentioned only at the end of Unit 6 and were not explained. Storing the random
numbers for each horse in an array is recommended, so you need to do some research.
There are presentations on Blackboard about arrays.
Results
With random numbers being used to determine winners, there is no expected result for a
race. However, you are required to record the actual results from at least 5 races with
different numbers of horses and different race lengths.
Reflection
Comment on the extra programming features you used in this project, mentioning how each
was used and how easy you found them.
APPENDIX 2 – B STAGE SEMESTER 1 2016 This
is an extension of C stage which must be completed first.
REQUIREMENTS
Your program should illustrate the progress of each horse in the race using a simple graph.
For example, using the race shown in C stage, two snapshots of the race’s progress may
look like this:
APPENDIX 3 – A STAGE SEMESTER 1 2016
Introduction
Having completed your horse racing simulation for stages C and B, you are now to produce
a simple graphical game based on the horse racing theme. Your game should use a
graphical user interface (such as with Windows Forms available with C#), and should allow
the user to follow the progress of a race on screen. You will be shown an example
interpretation of this, but you are given scope to be creative within these general criteria.
Code
As well as following programming standards and writing code that works, for an A grade you
will be expected to:
• Make good use of your own methods to prevent having to write a lot of repeated code.
• Use at least one class that you have written yourself.
Testing
Look up acceptance testing and discuss with your tutor what tests should be required.
Provide a report of the tests that you carried out.
Reflection
Comment on the programming features you used in this project, mentioning how each was
used and how easy you found them.
Furlong 3
One ****************
Two ******************
Three ******************
Four *********************
Five ************* Furlong 6
One ***************************
Two *************************************
Three ******************************
Four **************************************
Five *******************