Question: Programming Question: Use JAVA Language 1. cardCreator (Part I) Write a class named Card that consists of the following: A String variable named suit that

Programming Question: Use JAVA Language

1. cardCreator (Part I)

Write a class named Card that consists of the following:

  • A String variable named suit that holds of one of four suits (i.e. spade, club, heart, diamond)
  • A variable named value (you may choose whatever data type you'd like) that will store a value from 2 (lowest) to Ace (highest).

Write a method named cardCreator that accepts one parameter:

  • number (int)

The method will use this variable to determine how many cards to create. It should ensure the value provided for number is between 0 and 52. If a valid value is received, a new Card object should be created. The suit and value of a Card will be determined randomly by this method.

2. cardCreator (Part II)

The method should then let the User know what cards were created. Please note that the cards generated must be unique (i.e. a deck of cards only has one four of hearts for example). Be sure to include the method in a fully functioning class named Main.

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!