Question: *JAVA* *PLEASE INCLUDE NOTES* NYS Win 4 Lottery Class Attributes: name: NYS Win 4 gameTime: which may either Midday or Evening wagerAmt: which may be

*JAVA* *PLEASE INCLUDE NOTES*

NYS Win 4 Lottery Class Attributes:

name: "NYS Win 4"

gameTime: which may either Midday or Evening

wagerAmt: which may be $ .50 or $1.00

number: an integer value 0000 - 9999

For this assignment you are to develop both an uml diagram and the corresponding java class for a New York State Win 4 lottery ticket (ie. one instance of this object correlates to one NYS Win 4 Lottery ticket). The actual ticket rules have been simplified to take some of the complexity out of it.

Your java class will have the following:

1. a name attribute (name of the ticket "NYS Win 4"),

2. a gameTime attribute which can only have one of two values "Midday" or "Evening",

3. a wagerAmt attribute which can only have one of two values .50 or 1.00,

4. a number attribute which can contain an integer value between 0000 - 9999

5. either a default constructor or an overloaded constructor or both

6. both the getter, setter methods for each of the attributes

7. a quickDraw method which uses the Random class to generate and assign the value for the number attribute

8. a toString method

9. include a main method with your class that instantiates 3 NYS Win 4 objects and output their contents calling their toString() method.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!