Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 02-27-2005, 01:07 PM   #1
Beta Member
Join Date: Feb 2005
Posts: 1
Default Homework Help! Urgent! (Java)

Probably a very simple programfor Java, but I am completely stumped.
Any help in coding (even hints) for this would be GREATLY appreciated.
If you would like to contact me directly, my AIM is XscarsofdesireX.

Write a class called Card where each object represents a card. The class should have three instance variables.
int myNum (stores a value 1 to 52)
String mySuit (suit of the card- to be determined by myNum)
String myValue (value of the card -1,....10,Jack, Queen, King, Ace)
(use integer division for mySuit and % for myValue)

The class should have a setValue() and setSuit(). They should be called in the constructor.

Then write a class called DeckOfCards that holds 52 objects of type cards. Write methods that will assign each card a different number 1 to 52, will shuffle the deck, will deal a card, and tell how many cards are left.

Create a driver that will shuffle the deck, then pring out as many cards as the user wants dealt from the top of the deck.
xscarsofdesirex is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 06:09 PM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0