Smartgambler
Pro-Punter

Go Back   OZmium Sports Betting and Horse Racing Forums > Public Forums > Horse Race Betting Systems
User Name
Password
Register FAQ Search Today's Posts Mark all topics as read

To advertise on these
forums, e-mail us.

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10th April 2011, 11:11 AM
wesmip1 wesmip1 is offline
Member
 
Join Date: Sep 2005
Posts: 1,601
Default Learn to Code Your Own Horse Racing Database - Lesson 2

Lesson 2:

Another lesson of basics but they need to be covered. This lesson is very important. It will take you through doing simple maths and manipulating the data. It will also give you a few conditional statements and looping constructs so that you can do things with the data. Conditional statements are very important as you will use these for developing ratings. For example If Horse1 finished first last start then give it a rating of 100 else give it a rating of 10. Looping will be very important as it allows you to use the same code for a group of things. For example loop through and apply the rating statement above for horses 1 to 10.

For this lesson you are going to need to :

1.If you haven't done Lesson 1 then go do it at http://www.propun.com.au/racing_for...243&postcount=1

2. Go to http://download.oracle.com/javase/t...epts/index.html and read the information. This page will give you an idea on how the principles behind coding in java work. It will introduce you into Object oriented programming and what an Object is and how you use it.

3. Read through and do the exercises for http://download.oracle.com/javase/t...olts/index.html. This is going to introduce you to some of the basics on programming including variables, types and simple maths. It will then take you through some simple control logi such as if-then-else and while statements.

4. Time to reinforce your understanding and do a couple of exercises. Firstly define 2 variables with a number. Call these variables horseRating1 and horseRating2. Print these to the screen.

5. Change the above program to determine the assessed odds based on the ratings. For example if horseRating1 = 50 and horseRating2 = 50 then the assessed odds of both horses should be $2.00. To determine the assessed odds use 1/rating. Output these value to the screen.

6. Change the above program to hold the ratings in an array. Output the results.

7. Change the above program to use a if-then-else statement to determine the horse with the highest rating. Output only the horse with the highest rating.

8. Create a new program that will take a number and add 1 to it in a while loop. Each time it increases by 1 output the results to the screen. Start at 0 and increase the number to 20.

9. Change the above program to do this with a for statement.

10. Change the above program to use a break when the number gets to 10. Make sure you understand how the break works and the output only counts to 10.


That should take a while for those new to programming. There are some very important concepts in these weeks lesson. If you can do all of the above you are half way there and will be at the start of creating your own database.

It won't be long till we get into the specifics of coding our own database.
Reply With Quote
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump



All times are GMT +10. The time now is 04:56 AM.


Powered by: vBulletin Version 3.0.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
©2008 OZmium Pty. Ltd. All rights reserved . ACN 091184655