No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
4 Posted Topics
Alright, so for the output: 0 2 4 6 8 10 1 3 5 7 9 11 3 6 9 12 15 18 6 10 14 18 22 26 ... (the pattern presented goes on forever) a code must be written to create it. I know I need a for … | |
So I've spent the past 2 hours trying to work all of this out, but I am still getting an error message that seems out of place. import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.util.*; public class HiLo extends JApplet { Image cardImages; /** * An image that holds the … | |
[code]public Card getCard(int position) { /** * Gets the card from the specified position in the hand. * Null is returned if the position isn't in the hand. */ if(position>=0 && position < hand.size()) return (Card)hand.removeElementAt(position); else return null; }[/code] error message: return (Card)hand.removeElementAt(position); is highlighted, "inconvertible types" | |
import java.awt.*; import java.awt.event.*; import javax.swing.*; public class HiLo extends JApplet { Image cardImages; /** * An image that holds the pictures of all the cards */ public void init() { /** * This method loads the card picture and lays out the applet. */ cardImages = getImage(getCodeBase(), "smallcards.gif"); setBackground(Color.blue); … |
The End.