IT418 - C# Programming Project: Lottery Number Generator

July 21, 2016 | Author: CarmenLim07 | Category: Types, School Work, Essays & Theses
Share Embed Donate


Short Description

A documentation about a program made in CSharp that draws winning lottery combinations from Grand Lotto to Ez2....

Description

2012 IT418 – C# Programming Project

INFORMATICS COMPUTER SCHOOL DIT PROJECT (IT418 – C# PROGRAMMING) < Philippine Charity Sweepstakes Office Lottery Digits Generator >

Name/s: Lim, Ma. Carmen N. Address: 37 Padua St. BFRV LPC, M.M. Student No.: 0000 - 7999 Lecturer: Sir Rudrian Riener Pariñas Center: 0535

0535 - 0000 – 7999 (I-DIT)

Country: Republic of the Philippines

1

2012 IT418 – C# Programming Project TABLE OF CONTENTS I.

Description and details of game to be simulated

p.3

II. Specification 2.2 Input Specification

p.4

2.3 Screen Design

p.5

2.4 Program Design

p.6

2.5 Validation and processing

p.7

III. Program Listing

pp.8 - 11

IV. Testing 4.1 Test Plan 4.2 Test Cases 4.3 Test Log 4.4 Screen Dumps

p.12 pp.13 - 27 p.28 pp.29 - 30

V. Implementation 5.1 User Manual

pp.31 - 37

6.1 Strengths

p.38

6.2 Weaknesses

p.39

6.3 Enhancements

p.39

VII. Critical Appraisal

p.40

ACKNOWLEDGEMENTS

p.41

0535 - 0000 – 7999 (I-DIT)

VI. Conclusion

2

2012 IT418 – C# Programming Project CHAPTER I: DESCRIPTION AND DETAILS OF GAME TO BE SIMULATED A Lottery Digit Generator Machine for Philippine Charity Sweepstakes office is the motif of this documentation. Practically, the machine is going to be used to randomly select winning lottery digit combinations in general for all categories of the said game. It is going to be digitally composed following the concepts of visual C# language. Now, C# is another variant of an Object Oriented Programming language developed by Microsoft which combines C++ principles into the rich environment of Visual basic that supports „windows-application-tools‟. The computer language is basically kept simple yet can perform as much tasks as other programming platforms. It was actually designed to be comprehensible to developers as it still follows through C language concepts. What sets C# language apart among other programming format is that, it works with the .NET Framework which provides a comprehensive and consistent programming model for building applications that have visually stunning user experiences and at the same time enforces “Simple Object Access Protocol” (SOAP) which doesn‟t require developers to put additional codes for repeating a behavior in a program. Thus, C# language is deemed appropriate to design and craft our

works well with streamlined visuals which make it light to operate.

0535 - 0000 – 7999 (I-DIT)

PCSO Lottery Digit Generator because of its convenient encryption of syntaxes that

3

2012 IT418 – C# Programming Project CHAPTER II: SPECIFICATION 3.1 Input Specification These are the data to be entered to run the lottery digit generator, where in, there is only one text input on the number of draws then most of them are buttons. Lottery Digits Generator (frmLotto) Text

textBox21

textBox21

pbNextDraw

NextDraw >

pbSort

Sort Numbers

btnStore

Store Digits

pbEnd2

END

toolStripMenuItem1

File

miAbout

About

miExit

Exit

mibtnHelp

Help

btClose

Close

button1

OK

Description This is used to enter a draw number that counts a session. This button should be pressed one at a time per draw attempt in a game session. This button should only be pressed after a singular attempt on drawing winning lotto numbers. This button is pressed last after drawing and sorting the winning lotto numbers as it saves those as used in DB.mdb. This button can be pressed whenever the user feels like closing the application. This button is only necessary if a user wants to view technical details about the game system and exit the program. This command is pressed if the user was curious about technical detail of the game system. Press this command to exit. This command is pressed to direct the user on how to use the controls of the PCSO ottery digits generator. About (frmAbout) Pressed whenever the user feels like leaving that message box. Help (form1) Pressed whenever the user feels like leaving the help screen.

Data Type

Size

String

n/a

W,H (121 , 30)

n/a

W,H (92 , 28)

n/a

W,H (92 , 27)

n/a

W,H (121 , 30)

n/a

W,H (121 , 30)

n/a

W,H (121, 30)

n/a

W,H (121, 30)

n/a

W,H (121, 30)

n/a

W,H (121, 30)

n/a

W,H (121, 30)

0535 - 0000 – 7999 (I-DIT)

Input Variable

4

2012 IT418 – C# Programming Project 3.2 Screen Design frmLotto.cs File

Help

menuStrip1

About Exit

groupBox1

PCSO Lottery Draw label2

Panel3

pictureBox1

Winning lotto numbers for:

PCSO.jpg

DD MM YY labelDayTime

Next Draw > pnNextDraw label3 Draw No:

Label6

6 Digit:

textBox21

1

2

3\

4

5

Label7 5 Digit:

11

10

9

8

7

Label8 4 Digit:

15

14

13

12

Label9 3 Digit:

18

17

20

19

pbSort

6

btnStore

16

pbEnd2

Label10 EZ2:

TextBox SORTED!! labelSort

Panel2 Panel1 May the luckiest one win!! Label5

frmAbout.cs

Label1 HOW TO:

picture Box1

richTextBox1

Button1

Label1 Label3

btnClose

0535 - 0000 – 7999 (I-DIT)

Form1.cs (Help)

5

2012 IT418 – C# Programming Project

3.3 Program Design

End Button Pressed

A

3.3.a Program Flow Chart START Other Buttons

B

Help Button

pressed?

Enter a Draw No 1st

frmAbout frm = new frmAbout(); frm.ShowDialog();

Next Draw Button Pressed

Label4.Text will count the number of draw attempt.

Other Buttons pressed?

Sort Button Pressed

Sorts all numbers drawn in textBox1.Text to textBox2.Text in ascending order.

textBox1 to textBox20 shall randomly pick digits according to a type of lottery game.

File Button

Store Button Pressed

Form1.cs pops up

MS Jet will append all lottery data items into DB.mdb

C About or exit button?

The freshly drawn digits are written in DB.mdb as USED numbers.

About Button pressed

frmAbout frm = new frmAbout();

All drawn numbers in textbox1 to textBox20 is sorted!

Label4.text = draw attempt no. then GrandLotto, 5D, 4D, 3D, EZ2 digits displayed in textBox1 to textBox20 sporadically.

Exit Button Pressed

frm.ShowDialog();

frmAbout Appears

labelSort .text = Sorted!!

C B

Close Button Pressed

A

TERMINATE

0535 - 0000 – 7999 (I-DIT)

What Button pressed?

6

2012 IT418 – C# Programming Project

3.4 Validation and processing A Validation Check will be conducted in this section of the PCSO Lottery Digits generator to keep inputs specific and ensure that these inputs are executing

Check No.

Data

Name

Input Type

Uniqueness

Length

Range

Process

The numbers are entered manually here which cannot be null and are subject to change every draw.

Only three numbers are allowed to be entered into the draw Number textbox.

Limited to three digits only as in ### upto 365 as to a year

Gets draw number data then stores it in a database when store digits button is clicked.

1

textBox21

Draw Num

A draw number counts a session and should only accept integers 1 > extract that into the desktop and taddah!! The system is transferred. After the installation we shall proceed to opening then operating the Lottery Machine. B.1. CD-RW Installation (Wizard): 1.) From the PCSO Lottery Machine CDRW, extract zipped folders into desktop first then the user will see theses icons on the window. They

2.) Once double clicked an application warning will show, don‟t feel threatened by that message for that is normal. Ignore the warning and click install.

0535 - 0000 – 7999 (I-DIT)

can double click any of the two icons to install the application.

3 3

2012 IT418 – C# Programming Project 3.) Right when install button was clicked the Lottery Machine will be automatically start and installed into “windows program files” and will show up in the “all programs” panel when the user hits the start button. Opening and Operating the PCSO Lottery Digits Generator Machine:

1.) We

have

transferred

the

now Lotto

folder into the desktop all we have to do now is double click it.

2.) Locate the lotto icon that looks like this

0535 - 0000 – 7999 (I-DIT)

in the face of that folder.

3 4

2012 IT418 – C# Programming Project

3.) After clicking the ICON the MICROSOFT Visual Studio 2008 Express Edition Editor will appear from there go to the solution explorer then double click on frmLotto.cs

Click frmLotto.cs TWICE!!

4.) The user is now in the designer view

they don‟t have to do anything but press the play button. PAK!!

0535 - 0000 – 7999 (I-DIT)

of the program

3 5

2012 IT418 – C# Programming Project The Program is now running, we shall now control our PCSO

Area where drawn Lottery Numbers will Appear!

Lottery Digits Generator. Its interface will just be explained for this phase.

REQUIRED: Before you can use the controls you should input a draw number into the textbox provided. MAIN CONTROLS: A.) To draw lottery number simply press Next Draw > button it will start selecting numbers in random according to the lottery game type. Notice the Draw No label change to indicate the count of attempts. B.) To sort out the numbers simply click Sort Numbers Button. C.) Click Store Digits to store winning digit combinations into MS Access

when this is successful. ADDITIONAL Controls: END – to close the program. FILE – to view about dialog box. HELP- built in tutorial for the lottery machine.

0535 - 0000 – 7999 (I-DIT)

database. A message box will inform the user that the data has been saved

3 6

2012 IT418 – C# Programming Project Store Number Button Usage: Let‟s say, the user has already drawn winning lottery digits and stored it

in a

database using the Store Digits button in the machine‟s interface.

A Message box that states the lottery digits are stored into a database so they will be marked as USED. When this happens the user can view the numbers stored in a database so they can take note of it. To do that they should go to the database explorer in the visual studio interface of the lottery solution then expand the

and click retrieve data. The stored digits will be displayed in that tables field right away

0535 - 0000 – 7999 (I-DIT)

table folder then right click on the UsedNums table

3 7

2012 IT418 – C# Programming Project CHAPTER VI: CONCLUSION 6.1 Strengths

The PCSO Lottery Digits Machine is now fully operational and has surpassed the development and trial stages, as stated earlier, following through the discipline of C# language.

The gaming system holds to its promise as a mechanically efficient tool than its predecessor as it can now draw numbers from 1 to 66 accurately in textboxes by assigning them into an array that is then handled by a random selector.

There is an algorithm at the back end of this lottery system to ensure the credence of the winning number combinations that were drawn by the machine. After the numbers have been drawn it can be sorted by a button in a descending order to keep things organized.

What makes this program all the more special is that it has a storage feature that writes the winning digits drawn into an MS Access Database for the purpose of eliminating the numbers that have been used.

current date and time of a draw to chronicle the session. There is also a label that counts the number of attempts the lottery machine made a draw. Therefore, the machine is certified marvelous!

0535 - 0000 – 7999 (I-DIT)

Finally, the Lottery Machine has been topped off with a label that shows the

3 8

2012 IT418 – C# Programming Project 6.2 Weaknesses As much as there are a bundle of good points about the PCSO Lottery Number Generating Machine there are fault areas in it and blame that to the noobieness of the programmer. Since the developer is only a student in Informatics Filinvest at this time she still has a lot more to learn about this branch of information technology but the fact that she was able to add the important details makes her competent. However, having the lottery numbers stored in an external database for elimination will trouble the user to view it in a distant folder where in they constantly have to find that source file. Generated lottery numbers are not automatically removed from the random selection so the users will need to consciously note down the numbers used from its inclusive database and remember that.

6.3 Enhancements The PCSO lottery machine can improve by adding another feature which allows users to view the USED lottery winning numbers in a table of a database in a subform within the machine so they won‟t have to leave the program to check what has been appended in there. Lottery digits that have been drawn should be deleted automatically when it has been generated so the user won‟t have to take

desired results.

0535 - 0000 – 7999 (I-DIT)

note of the numbers manually and avoid drawing digits many times to achieve

3 9

2012 IT418 – C# Programming Project CHAPTER VIII: Critical Appraisal This is where the documentation for PCSO Lottery Generating machine comes to an end and the developer is asked to write closing remarks and insight pertaining to the creation of this project. She would like to impart that it has been enjoyable creating a program in C# because it is very light and easy to use and much convenient that other C language formats. It works very well with .NET Framework and employs Simple Object Access Protocol to keep syntaxes into a minimal. Connecting C# programs into a database is also very easy accompanied by the database explorer panel as well for supervision. The developer would like to create more games using the computer language in the future but unfortunately C# language has been depreciated according to a mentor and is rarely used these days. Perhaps the developer can only use C# for recreation and leisure only

0535 - 0000 – 7999 (I-DIT)

unless it becomes a necessity again someday.

4 0

2012 IT418 – C# Programming Project ACKNOWLEDGEMENTS First of all, My special thanks to the almighty God who blessed me with the capability to complete such tasks, my family and friends who encouraged and supported me in my education through out. Extending my credits to the hard work and dedication of the entire management and staff of Informatics Filinvest Alabang meant for our quality education. My utmost gratitude to Sir Rudrian Riener Pariñas for ensuring we learn every

0535 - 0000 – 7999 (I-DIT)

crucial lesson there is regarding C# programming wit respects to game development.

4 1

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF