Question: Programming and Logic 1: Java NYS Win 4 Lottery Class Attributes: name: NYS Win 4 gameTime: which may either Midday or Evening wagerAmt: which may

Programming and Logic 1: Java

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:

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

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

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

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

either a default constructor or an overloaded constructor or both

both the getter, setter methods for each of the attributes

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

a 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!