I created this project during my fourth semester at Penn State, where I was taking IST 261 - Application Development Studio I. I was tasked with creating an application that simulated a lottery drawing for this project. First, through a user interface, the user can select six numbers of their choosing and how many lottery drawing they'd like to emulate. Then, the program will produce an output of how many lottery drawings matched their numbers, corresponding to how many matches were found per simulation.
While creating this project, I used the Model-View-Controller design principle to structure my program. For the model class, I made a method that would randomly pick six integers from 1 - 60. The function would then return a HashSet of the six integers chosen. A HashSet was used to prevent multiple random numbers with the same value. In my view class, I utilized Java's GUI library, swing, to create the user interface. Lastly, I made a view and model object for my controller class and used logic to call the respective methods to accomplish the project goal.
Technologies
Java Swing
Java HashMap
Java HashSet
Java Random
Back